Does it support Ergo erpc:call/erpc:cast to Erlang node? #126
Answered
by
halturin
leonlee2013
asked this question in
Q&A
-
Ergo rpc:call/erpc:cast to Erlang node is supported, the code is as follows: https://github.com/ergo-services/ergo/blob/master/gen/server.go // CallRPCWithTimeout evaluate rpc call with given node/MFA and timeout
func (sp *ServerProcess) CallRPCWithTimeout(timeout int, node, module, function string, args ...etf.Term) (etf.Term, error) {
lib.Log("[%s] RPC calling: %s:%s:%s", sp.NodeName(), node, module, function)
message := etf.Tuple{
etf.Atom("call"),
etf.Atom(module),
etf.Atom(function),
etf.List(args),
sp.Self(),
}
to := ProcessID{"rex", node}
return sp.CallWithTimeout(to, message, timeout)
}
// CastRPC evaluate rpc cast with given node/MFA
func (sp *ServerProcess) CastRPC(node, module, function string, args ...etf.Term) error {
lib.Log("[%s] RPC casting: %s:%s:%s", sp.NodeName(), node, module, function)
message := etf.Tuple{
etf.Atom("cast"),
etf.Atom(module),
etf.Atom(function),
etf.List(args),
}
to := ProcessID{"rex", node}
return sp.Cast(to, message)
} But I didn't find any code or api related to erpc:call/erpc:cast to Erlang node. |
Beta Was this translation helpful? Give feedback.
Answered by
halturin
Dec 7, 2022
Replies: 1 comment 2 replies
-
It doesn't support the new erpc way of communication yet. I would strongly recommend using the OTP-way, because RPC in erlang has performance issues and very limited features. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
leonlee2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It doesn't support the new erpc way of communication yet. I would strongly recommend using the OTP-way, because RPC in erlang has performance issues and very limited features.