macro_rules! actor { ($core:expr, $type:ident :: $init:ident($($x:expr),* $(,)? ), $notify:expr) => { ... }; ($core:expr, <$type:ty> :: $init:ident($($x:expr),* $(,)? ), $notify:expr) => { ... }; }
Expand description
Create a new actor and initialise it
ⓘ
let actor = actor!(core, Type::init(args...), notify);
let actor = actor!(core, <path::Type>::init(args...), notify);
This may be used when creation and initialisation of the actor can
be done together. Otherwise see actor_new!
. The actor is
created and then the given initialisation function is called
asynchronously. The notify
argument is a Ret<StopCause>
instance to call if the actor is terminated. An ActorOwn
reference is returned.
If the logger feature is enabled then an Open log-record
is written for the new actor. If the core
argument is actually
a Cx
then the actor-ID of the actor that the Cx
belongs to
will be recorded as the parent actor.
Implemented using ActorOwn::new
.