Messages

Messages to YAActL actors have Message as a common abstract type. Only three predefined messages are exported:

  • Response: response message type from actor to any synchronous message (requiring a response),
  • Request: predefined message type for implementing requests to actors.
  • Timeout: answer of receive! when a timeout occurs.

Messages other than the predefined ones can be implemented by a user.

Functions and Arguments

There are two types needed for transmitting functions and function arguments to actors with messages:

YAActL.FuncType
Func(f, args...; kwargs...)

A structure for passing a function f and its arguments to an actor.

source
YAActL.ArgsType
Args(args...; kwargs...)

A structure for updating arguments to an actor's behavior.

source

Internal Messages

Actors recognize and react to the following predefined internal messages:

YAActL.CallType
Call(arg, from::Link)

A synchronous Message to an actor to execute its behavior with arg... and to send the result as a Response message to from.

If the actor is set to state dispatch, it updates its internal state with the result.

source
YAActL.CastType
Cast(arg)

An asynchronous Message to an actor to execute its behavior with arg... without sending a response.

If the actor is set to state dispatch, it updates its internal state with the result.

source
YAActL.DiagType
Diag(from::Link)

A synchronous Message to an actor to send a Response message with its internal _ACT variable to from.

source
YAActL.ExecType
Exec(func::Func, from::Link)

A synchronous Message to an actor to execute func and to send a Response message with the return value to from.

source
YAActL.QueryType
Query(s::Symbol, from::Link)

A Message to an actor to send a Response message with one of its internal state variables s to from.

  • s::Symbol can be one of :sta, :res, :bhv, :dsp.
source
YAActL.StopType
Stop(code=0)

A Message causing an actor to stop with an exit code. If present, it calls its term! function with code as last argument.

source
YAActL.UpdateType
Update(s::Symbol, x)

An asynchronous Message to an actor to update its internal state s to x.

  • s::Symbol can be one of :sta, :dsp, :arg, :lnk.
source

Those messages are interfaced by the functions in the YAActL API.

If an actor receives another subtype of Message, it calls its behavior function with it as last argument.