Struct apalis_core::worker::Addr
source · pub struct Addr<A: Actor> { /* private fields */ }Available on crate feature
worker only.Expand description
Address of actor. Can be used to send messages to it.
Implementations§
source§impl<W: Actor> Addr<W>
impl<W: Actor> Addr<W>
sourcepub async fn send<M>(&self, message: M) -> Result<M::Result, RecvError>where
M: Message + Send + 'static,
M::Result: Send,
W: ContextHandler<M>,
pub async fn send<M>(&self, message: M) -> Result<M::Result, RecvError>where
M: Message + Send + 'static,
M::Result: Send,
W: ContextHandler<M>,
sourcepub async fn do_send<M>(&self, message: M) -> Option<M::Result>where
M: Message + Send + 'static,
M::Result: Send,
W: ContextHandler<M>,
pub async fn do_send<M>(&self, message: M) -> Option<M::Result>where
M: Message + Send + 'static,
M::Result: Send,
W: ContextHandler<M>,
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,
Constructs recipient for sending only specific messages
sourcepub fn expect_running(self) -> AlwaysAddr<W>
pub fn expect_running(self) -> AlwaysAddr<W>
Contstructs address which will never panic on sending.
Beware: You need to make sure that this actor will be always alive