Trait flo_stream::MessagePublisher[][src]

pub trait MessagePublisher where
    Self: Send
{ type Message: 'static + Send; fn subscribe(&mut self) -> Subscriber<Self::Message>;
fn when_ready(&mut self) -> BoxFuture<'static, MessageSender<Self::Message>>;
fn when_empty(&mut self) -> BoxFuture<'static, ()>;
fn is_closed(&self) -> bool;
fn when_closed(&self) -> BoxFuture<'static, ()>; fn publish(&mut self, message: Self::Message) -> BoxFuture<'static, ()> { ... } }
Expand description

Trait that provides functions for publishing messages to subscribers

Associated Types

Required methods

Creates a subscription to this publisher

Any future messages sent here will also be sent to this subscriber.

Reserves a space for a message with the subscribers, returning when it’s ready

Waits until all subscribers have consumed all pending messages

Returns true if this publisher is closed (will not publish any further messages to its subscribers)

Future that returns when this publisher is closed

Provided methods

Publishes a message to the subscribers of this object

Implementors