Basic Types

The following types are needed for using and extending Actors:


Abstract type for messages to actors.

Response(y, from::Link=self())

A Msg representing a response to requests.


  • y: response content,
  • from::Link: sender link.
Link{C} <: ActorInterfaces.Classic.Addr
Link(chn::C, pid::Int, type::Symbol) where C

A mailbox for communicating with actors. A concrete type of this must be returned by an actor on creation with spawn.


  • chn::C: C can be any type and characterizes the interface to an actor,
  • pid::Int: the pid (worker process identifier) of the actor,
  • mode::Symbol: a symbol characterizing the actor mode.
Bhv(func, a...; kw...)(c...)

A callable struct to represent actor behavior. It is executed with parameters from the incoming communication.


  • f: a callable object,
  • a...: stored acquaintance parameters to f,
  • kw...: stored keyword arguments,
  • c...: parameters from the incoming communication.

You can create your own message types with

@msg [Msg] A B C

Define empty structs as message types. Msg is an existing abstract datatype.

To call @msg Msg A B C is equivalent to

struct A <: Msg end
struct B <: Msg end
struct C <: Msg end

To call @msg D E F is equivalent to

struct D end
struct E end
struct F end