[erlang-questions] Mixing casts and calls

David Welton davidnwelton@REDACTED
Tue Jan 21 17:49:32 CET 2014

> Assuming your Erlang node handles the RPC call from the Java node with a gen_server, why not respond with {no_reply, ...} to the Java-server, send an asynchronous request to the C-server, handle the response in a handle_info, and then reply to the Java-server with gen_server:reply/2? This way, you leave all the timeout handling to the Java-node.
> The issue with this approach is that you must find a way to preserve the >From argument to your handle_call callback, so that you can pass it on to gen_server:reply/2 at a later stage, but that might be an easier problem to solve.

I had overlooked/not thought of that, so that is a pretty good
solution and relatively clean from our point of view.

Thank you!
David N. Welton



More information about the erlang-questions mailing list