ergo-services / examples

examples for demonstrating Ergo Framework features
MIT License
25 stars 3 forks source link

RPC example #5

Open saleyn opened 1 month ago

saleyn commented 1 month ago

Is there an example of making an RPC call (e.g. rpc:call(RemoteNode, erlang, node, [])) from go to erlang?

halturin commented 1 month ago

No support so far. Maybe in the future releases of proto/erlang23. But for now, the main problem to implement this feature is how Erlang handles Remote Spawn request in the DIST proto (RPC requests are using this feature under the hood) - Erlang always returns PID value, even on fails (just returns fake pid in such cases and "This is the intended behavior" they said). At the same time, documentation for the SPAWN_REPLY says

Result of the operation. If Result is a process identifier, the operation succeeded and the process identifier is the identifier of the newly created process. If Result is an atom, the operation failed and the atom identifies failure reason

It can be workarounded, for sure, but requires way more frictions.

PS please, don't close this issue, may be somebody else is looking for an answer for the same question.