[][src]Trait actix::ActorContext

pub trait ActorContext: Sized {
    pub fn stop(&mut self);
pub fn terminate(&mut self);
pub fn state(&self) -> ActorState; }

Actor execution context.

Each actor runs within a specific execution context. The actor's associated type Actor::Context defines the context to use for the actor, and must implement the ActorContext trait.

The execution context defines the type of execution, and the actor's communication channels (message handling).

Required methods

pub fn stop(&mut self)[src]

Immediately stop processing incoming messages and switch to a stopping state. This only affects actors that are currently running. Future attempts to queue messages will fail.

pub fn terminate(&mut self)[src]

Terminate actor execution unconditionally. This sets the actor into the stopped state. This causes future attempts to queue messages to fail.

pub fn state(&self) -> ActorState[src]

Retrieve the current Actor execution state.

Loading content...

Implementors

impl<A> ActorContext for Context<A> where
    A: Actor<Context = Self>, 
[src]

impl<A> ActorContext for SyncContext<A> where
    A: Actor<Context = Self>, 
[src]

pub fn stop(&mut self)[src]

Stop the current Actor. SyncContext will stop the existing Actor, and restart a new Actor of the same type to replace it.

pub fn terminate(&mut self)[src]

Terminate the current Actor. SyncContext will terminate the existing Actor, and restart a new Actor of the same type to replace it.

pub fn state(&self) -> ActorState[src]

Get the Actor execution state.

Loading content...