partisan icon indicating copy to clipboard operation
partisan copied to clipboard

Add call emulation for `forward_message`.

Open evanmcc opened this issue 8 years ago • 0 comments

currently PeerServiceManager:forward_message(Node, Target, Message) uses gen_server:cast to send its message on the recipient node. It would be nice to support the semantics of gen_server:call as well. This presents two issues:

  1. call sets up a monitor on the remote server that it is sending to (I'll address this in another issue).
  2. call blocks until there is a reply. The current code neither blocks nor conveys any reply.

I have some basic code that implements remote sends, casts, and calls. However, it doesn't really work well for calls, since the gen_server:call at the remote end (in partisan_peer_service_server) doesn't do any multiplexing and could be blocked for a long time, interfering with unrelated calls and casts on the same node to node edge. So that needs to be fixed, and replies need to be added.

evanmcc avatar Apr 22 '17 00:04 evanmcc