Messaging Protocol

Actors has predefined message types with respective onmessage methods. This gives your actors predefined behaviors going beyond the classical behavior.

Messaging Patterns

The actor protocol can be described as a series of messaging patterns. For every predefined message an actor executes a predefined onmessage method. Here is an overview:

Message patternbrief description
BecomeTell an actor to change its behavior.
Call - ResponseCall an actor to execute its behavior and to respond with the result.
Diag - ResponseCall an actor to respond with diagnostic information.
DownA message to a monitor actor signaling an exit or a failure.
ExitA message causing an actor to exit.
Exec - ResponseCall an actor to execute a function and to respond with the result.
InitTell an actor to execute an initialization function and to store it in its internal state.
Query - ResponseCall an actor to send a status variable/value.
RequestThis triggers the actor's default response to execute its behavior.
TermTell an actor to execute a given behavior upon termination.

There are messages for bidirectional and unidirectional communication (the latter for actor control without response).

User API Functions

Actors' user API functions provide an interface to those message patterns.

Enhancing the Protocol

The Actors protocol can be enhanced or altered by

  • introducing new messages and onmessage methods,
  • switching the actor mode and writing new onmessage methods for existing messages
  • or both.

Libraries can do this for specific duties and plugin their protocols into Actors. Examples of such libraries are GenServers and Guards.