Actor Primitives
The following primitives characterize actors in the classical Actor Model:
Primitive | Brief description |
---|---|
self | get the address of the current actor, |
spawn | create an actor from a behavior and return an address, |
send | send a message to an actor, |
become | an actor designates a new behavior, |
Functions
ActorInterfaces.Classic.send
— Functionsend(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.
Actors.become!
— Functionbecome!(lk::Link, func, args1...; kwargs...)
become!(name::Symbol, ....)
Cause an actor to change behavior.
Arguments
- actor
lk::Link
(orname::Symbol
if registered), func
: a callable object,args1...
: (partial) arguments tofunc
,kwargs...
: keyword arguments tofunc
.
ActorInterfaces.Classic.become
— Functionbecome(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 tofunc
,kwargs...
: keyword arguments tofunc
.
ActorInterfaces.Classic.self
— Functionself()
Get the Link
of your actor.
Actors.stop
— Functionstop(reason=:normal)
Cause your actor to stop with a reason
.