Messaging
Communication between actors is achieved exclusively through message passing. In GoAkt Google Protocol Buffers are used to define messages. The choice of protobuf is due to easy serialisation over wire and strong schema definition. As stated previously the following messaging patterns are supported:
Tell/RemoteTell- send a message to an actor and forget it.Tellis used for local messaging.Ask/RemoteAsk- send a message to an actor and expect a reply within a time period.Askis used for local messaging.SendAsync- behave the same way asTell. This call is location transparent which means that the system will locate the given actor whether locally or remotely to send the message. This is possible when cluster mode is enabled.SendSync- behave the same way asAskexcept the location of the provided actor is transparent. This is possible when cluster mode is enabled.Forward- pass a message from one actor to the actor by preserving the initial sender of the message. At the moment you can only forward messages from theReceiveContextwhen handling a message within an actor and this to a local actor.ForwardTo- behave the same asForwardbut when cluster mode is enabled.BatchTell- send a bulk of messages to actor in a fire-forget manner. Messages are processed one after the other in the other they have been sent.BatchAsk- send a bulk of messages to an actor and expect responses for each message sent within a time period. Messages are processed one after the other in the other they were sent. This help return the response of each message in the same order that message was sent. This method hinders performance drastically when the number of messages to sent is high. Kindly use this method with caution.PipeToandPipeToName- send the successful result of a future (long-running task) to self or a given actor. See PipeTo
Last updated