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.Func — Type
Func(f, args...; kwargs...)

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

source
YAActL.Args — Type
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.Call — Type
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.Cast — Type
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.Diag — Type
Diag(from::Link)

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

source
YAActL.Exec — Type
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.Query — Type
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.Stop — Type
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.Update — Type
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.