Struct meio::Context [−][src]
pub struct Context<A: Actor> { /* fields omitted */ }
Expand description
Context
of a ActorRuntime
that contains Address
and Receiver
.
Implementations
pub fn spawn_actor<T>(&mut self, actor: T, group: A::GroupBy) -> Address<T> where
T: Actor + StartedBy<A> + InterruptedBy<A>,
A: Eliminated<T>,
pub fn spawn_actor<T>(&mut self, actor: T, group: A::GroupBy) -> Address<T> where
T: Actor + StartedBy<A> + InterruptedBy<A>,
A: Eliminated<T>,
Starts and binds an Actor
.
pub fn spawn_task<T, M>(
&mut self,
task: T,
tag: M,
group: A::GroupBy
) -> TaskAddress<T> where
T: LiteTask,
A: TaskEliminated<T, M>,
M: Tag,
pub fn spawn_task<T, M>(
&mut self,
task: T,
tag: M,
group: A::GroupBy
) -> TaskAddress<T> where
T: LiteTask,
A: TaskEliminated<T, M>,
M: Tag,
Starts and binds a Task
.
Spawns interaction task that forwards the result of an interaction.
pub fn track_interaction<I, M>(
&mut self,
task: InteractionTask<I>,
tag: M,
group: A::GroupBy
) where
I: Interaction,
A: InteractionDone<I, M>,
M: Tag,
pub fn track_interaction<I, M>(
&mut self,
task: InteractionTask<I>,
tag: M,
group: A::GroupBy
) where
I: Interaction,
A: InteractionDone<I, M>,
M: Tag,
Spawns InteractionTask
as a LiteTask
and await the result as an Action
that will call InteractionDone
handler.
Interrupts an Actor
.
Returns Error
if the Actor
is terminating.
Useful for checking in handlers.
Stops the runtime of the Actor
on one message will be processed after this call.
It’s recommended way to terminate Actor
is the shutdown
method.
Attention! Termination process will never started here and all spawned actors and tasks will be orphaned.
Sends interruption signal to the sepcific group of actors and tasks.
Returns true if the shutdown process is in progress.
Increases the priority of the Actor
’s type.