Trait actix::prelude::Handler

source ·
pub trait Handler<M>where
    Self: Actor,
    M: Message,
{ type Result: MessageResponse<Self, M>; fn handle(&mut self, msg: M, ctx: &mut Self::Context) -> Self::Result; }
Expand description

Message handler

Handler implementation is a general way how to handle incoming messages, streams, futures.

M is a message which can be handled by the actor.

Required Associated Types§

The type of value that this handle will return

Required Methods§

Method is called for every message received by this Actor

Implementors§

Handle SIGINT, SIGTERM, SIGQUIT signals and send SystemExit(0) message to System actor.

Add subscriber for signals