Struct meio::Context [−][src]
pub struct Context<A: Actor> { /* fields omitted */ }
Expand description
Context
of a ActorRuntime
that contains Address
and Receiver
.
Implementations
impl<A: Actor> Context<A>
[src]
impl<A: Actor> Context<A>
[src]pub fn spawn_actor<T>(&mut self, actor: T, group: A::GroupBy) -> Address<T> where
T: Actor + StartedBy<A> + InterruptedBy<A>,
A: Eliminated<T>,
[src]
pub fn spawn_actor<T>(&mut self, actor: T, group: A::GroupBy) -> Address<T> where
T: Actor + StartedBy<A> + InterruptedBy<A>,
A: Eliminated<T>,
[src]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,
[src]
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,
[src]Starts and binds a Task
.
pub fn attach<S, M>(&mut self, stream: S, tag: M, group: A::GroupBy) where
S: Stream + Unpin + Send + 'static,
S::Item: Send,
A: Consumer<S::Item>,
M: Tag,
[src]
pub fn attach<S, M>(&mut self, stream: S, tag: M, group: A::GroupBy) where
S: Stream + Unpin + Send + 'static,
S::Item: Send,
A: Consumer<S::Item>,
M: Tag,
[src]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,
[src]
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,
[src]Spawns InteractionTask
as a LiteTask
and await the result as an Action
that will call InteractionDone
handler.
pub fn interrupt<T>(&mut self, address: &mut Address<T>) -> Result<(), Error> where
T: Actor + InterruptedBy<A>,
[src]
pub fn interrupt<T>(&mut self, address: &mut Address<T>) -> Result<(), Error> where
T: Actor + InterruptedBy<A>,
[src]Interrupts an Actor
.
pub fn not_terminating(&self) -> Result<(), Error>
[src]
pub fn not_terminating(&self) -> Result<(), Error>
[src]Returns Error
if the Actor
is terminating.
Useful for checking in handlers.
pub fn stop(&mut self)
[src]
pub fn stop(&mut self)
[src]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.
pub fn terminate_group(&mut self, group: A::GroupBy)
[src]
pub fn terminate_group(&mut self, group: A::GroupBy)
[src]Sends interruption signal to the sepcific group of actors and tasks.
pub fn is_terminating(&self) -> bool
[src]
pub fn is_terminating(&self) -> bool
[src]Returns true if the shutdown process is in progress.
pub fn termination_sequence(&mut self, sequence: Vec<A::GroupBy>)
[src]
pub fn termination_sequence(&mut self, sequence: Vec<A::GroupBy>)
[src]Increases the priority of the Actor
’s type.
Auto Trait Implementations
impl<A> !RefUnwindSafe for Context<A>
impl<A> Send for Context<A>
impl<A> !Sync for Context<A>
impl<A> Unpin for Context<A> where
<A as Actor>::GroupBy: Unpin,
<A as Actor>::GroupBy: Unpin,