Commit Graph

9 Commits

Author SHA1 Message Date
Asias He
9dff2bfa40 rpc: Fix indentation
Signed-off-by: Asias He <asias@cloudius-systems.com>
2015-04-08 17:10:53 +03:00
Asias He
60ece9f40d rpc: Do not initialize MsgType _type
Fix compiling issue when using rpc with MsgType other than int.

Signed-off-by: Asias He <asias@cloudius-systems.com>
2015-04-08 17:10:52 +03:00
Gleb Natapov
dbe2443c03 rpc: wait for message to be send in rpc::no_wait client's handlers
rpc::no_wait is too "no_wait" currently. When client sends a no_wait
message it immediately gets ready future in return, so client cannot
know when data is actually sent and can be discarded. This patch fixes
this by returning a future that will become ready when data is no longer
needed.
2015-04-01 14:55:58 +03:00
Gleb Natapov
5558abe9ec rpc: drop unused template parameter 2015-03-31 16:45:20 +03:00
Gleb Natapov
937970ccd3 rpc: keep shared pointer to a client connection
Client connection may outlive its do_until() loop. Make connection
point shared to overcome this. If connection dies while async handler
is running it will not be deleted until the handler is executed.
2015-03-25 11:32:33 +02:00
Gleb Natapov
9f0900ee0f rpc: add logger and log exception in no_wait callback 2015-03-22 16:16:23 +02:00
Gleb Natapov
12885b924c rpc: add a possibly to pass client_info to an rpc handler
If rpc handler needs locally held information about rpc client that
making a call it may have client_info as a first parameter of rpc
handler. Rpc framework will pass it to the callback during invocation.
2015-03-22 16:16:17 +02:00
Gleb Natapov
7fe06f006e rpc: introduce rpc::no_wait
If registered callback returns rpc::no_wait a client will not wait
for remote function execution and will get immediately ready future.
2015-03-22 16:16:09 +02:00
Gleb Natapov
36b76af7cc Implementation of rpc
To register rpc handler func(param1, param2, param3) both server and client

auto remote_func = myrpc.register_handler(id, func);

This call will return another function that client can use to invoke RPC
calls like this:

remote_func(client, param1, param2, param3);

This call will return future<> with func() result.
2015-03-12 15:38:18 +02:00