Trait actix_broker::BrokerSubscribe [−][src]
pub trait BrokerSubscribe: Actor<Context = Context<Self>> { fn subscribe_async<M: BrokerMsg>(&self, ctx: &mut Self::Context)
where
<M as Message>::Result: Send,
Self: Handler<M>, { ... } fn subscribe_sync<M: BrokerMsg>(&self, ctx: &mut Self::Context)
where
<M as Message>::Result: Send,
Self: Handler<M>, { ... } }
The BrokerSubscribe
trait has functions to register an actor's interest in different
messages.
Provided Methods
fn subscribe_async<M: BrokerMsg>(&self, ctx: &mut Self::Context) where
<M as Message>::Result: Send,
Self: Handler<M>,
<M as Message>::Result: Send,
Self: Handler<M>,
Asynchronously subscribe to a message.
fn subscribe_sync<M: BrokerMsg>(&self, ctx: &mut Self::Context) where
<M as Message>::Result: Send,
Self: Handler<M>,
<M as Message>::Result: Send,
Self: Handler<M>,
Synchronously subscribe to a message. This actor will do nothing else until its interest is registered. If messages of that type have been sent to the broker previously, a copy of the latest message is sent to the calling actor after it has subscribed.