-
Hi, in akka, I can just use the handle sender to send a reply message like Do I have to implement my own protocol (e.g. add result actor field in message struct) to be able to send a response to the calling actor ? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can see an example in https://slawlor.github.io/ractor/quickstart/#adding-state But the short answer is your message type needs to include the reply channel which is an The caller just needs to use either the |
Beta Was this translation helpful? Give feedback.
-
Thanks! I have overseen that. Is this the Erlang way to do this, or is there any reason not include the sender like in Akka ? My experience with actors are solely from Akka/Akka.net... |
Beta Was this translation helpful? Give feedback.
You can see an example in https://slawlor.github.io/ractor/quickstart/#adding-state
But the short answer is your message type needs to include the reply channel which is an
RpcReplyPort<_>
and the actor uses that to send the reply back.The caller just needs to use either the
call!
macro orActorRef<_>.call
which will handle sending the message and waiting for the reply.