[][src]Trait riker::actor::Actor

pub trait Actor: Send + 'static {
    type Msg: Message;
    pub fn recv(
        &mut self,
        ctx: &Context<Self::Msg>,
        msg: Self::Msg,
        sender: Sender
    ); pub fn pre_start(&mut self, ctx: &Context<Self::Msg>) { ... }
pub fn post_start(&mut self, ctx: &Context<Self::Msg>) { ... }
pub fn post_stop(&mut self) { ... }
pub fn supervisor_strategy(&self) -> Strategy { ... }
pub fn sys_recv(
        &mut self,
        ctx: &Context<Self::Msg>,
        msg: SystemMsg,
        sender: Sender
    ) { ... } }

Associated Types

Loading content...

Required methods

pub fn recv(&mut self, ctx: &Context<Self::Msg>, msg: Self::Msg, sender: Sender)[src]

Invoked when an actor receives a message

It is guaranteed that only one message in the actor's mailbox is processed at any one time, including recv and sys_recv.

Loading content...

Provided methods

pub fn pre_start(&mut self, ctx: &Context<Self::Msg>)[src]

Invoked when an actor is being started by the system.

Any initialization inherent to the actor's role should be performed here.

Panics in pre_start do not invoke the supervision strategy and the actor will be terminated.

pub fn post_start(&mut self, ctx: &Context<Self::Msg>)[src]

Invoked after an actor has started.

Any post initialization can be performed here, such as writing to a log file, emmitting metrics.

Panics in post_start follow the supervision strategy.

pub fn post_stop(&mut self)[src]

Invoked after an actor has been stopped.

pub fn supervisor_strategy(&self) -> Strategy[src]

Return a supervisor strategy that will be used when handling failed child actors.

pub fn sys_recv(
    &mut self,
    ctx: &Context<Self::Msg>,
    msg: SystemMsg,
    sender: Sender
)
[src]

Invoked when an actor receives a system message

It is guaranteed that only one message in the actor's mailbox is processed at any one time, including recv and sys_recv.

Loading content...

Implementations on Foreign Types

impl<A: Actor + ?Sized> Actor for Box<A>[src]

type Msg = A::Msg

Loading content...

Implementors

impl Actor for EventsChannel[src]

type Msg = ChannelMsg<SystemEvent>

impl<Msg> Actor for Channel<Msg> where
    Msg: Message
[src]

type Msg = ChannelMsg<Msg>

Loading content...