Struct apalis_core::worker::Context
source · pub struct Context<W: Actor> { /* private fields */ }Available on crate feature
worker only.Expand description
Context for execution of actor
Implementations§
source§impl<W: Actor> Context<W>
impl<W: Actor> Context<W>
sourcepub fn new(addr: Addr<W>, handle: JoinHandle<()>) -> Self
pub fn new(addr: Addr<W>, handle: JoinHandle<()>) -> Self
Default constructor
sourcepub fn recipient<M>(&self) -> Recipient<M>where
M: Message + Send + 'static,
W: ContextHandler<M>,
M::Result: Send,
pub fn recipient<M>(&self) -> Recipient<M>where
M: Message + Send + 'static,
W: ContextHandler<M>,
M::Result: Send,
Gets an recipient for current worker with specified message type
sourcepub fn notify<M>(&self, message: M)where
M: Message + Send + 'static,
W: ContextHandler<M>,
M::Result: Send,
pub fn notify<M>(&self, message: M)where
M: Message + Send + 'static,
W: ContextHandler<M>,
M::Result: Send,
Sends worker specified message
sourcepub fn notify_later<M>(&self, message: M, later: Duration)where
M: Message + Send + 'static,
W: Handler<M>,
M::Result: Send,
pub fn notify_later<M>(&self, message: M, later: Duration)where
M: Message + Send + 'static,
W: Handler<M>,
M::Result: Send,
Sends actor specified message in some time