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
sourceimpl<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
Trait Implementations
Auto Trait Implementations
impl<W> !RefUnwindSafe for Context<W>
impl<W> Send for Context<W>
impl<W> Sync for Context<W>
impl<W> Unpin for Context<W>
impl<W> !UnwindSafe for Context<W>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more