Actor Primitives

The following primitives characterize actors in the classical Actor Model:

PrimitiveBrief description
selfget the address of the current actor,
spawncreate an actor from a behavior and return an address,
sendsend a message to an actor,
becomean actor designates a new behavior,

Functions

ActorInterfaces.Classic.sendFunction
send(lk::Link, msg...)
send(name::Symbol, msg...)

Send a message to an actor lk (or registered name). msg... are communication parameters to the actor's behavior function.

source
Actors.become!Function
become!(lk::Link, func, args1...; kwargs...)
become!(name::Symbol, ....)

Cause an actor to change behavior.

Arguments

  • actor lk::Link (or name::Symbol if registered),
  • func: a callable object,
  • args1...: (partial) arguments to func,
  • kwargs...: keyword arguments to func.
source
ActorInterfaces.Classic.becomeFunction
become(func, args...; kwargs...)

Cause your actor to take on a new behavior. This can only be called from inside an actor/behavior.

Arguments

  • func: a callable object,
  • args...: (partial) arguments to func,
  • kwargs...: keyword arguments to func.
source
Actors.stopFunction
stop(reason=:normal)

Cause your actor to stop with a reason.

source