[−][src]Struct flo_stream::SinglePublisher
A single publisher is a publisher that sends each message to only a single subscriber rather than all of them
This is useful for scheduling messages on the first available worker.
Methods
impl<Message> SinglePublisher<Message>
[src]
pub fn new(buffer_size: usize) -> SinglePublisher<Message>
[src]
Creates a new single publisher, which will buffer the specified number of messages
pub fn count_subscribers(&self) -> usize
[src]
Counts the number of subscribers in this publisher
pub fn republish(&self) -> Self
[src]
Creates a duplicate publisher that can be used to publish to the same streams as this object
Trait Implementations
impl<Message> Drop for SinglePublisher<Message>
[src]
impl<Message: 'static + Send + Clone> MessagePublisher for SinglePublisher<Message>
[src]
type Message = Message
fn subscribe(&mut self) -> Subscriber<Message>
[src]
Subscribes to this publisher
Subscribers only receive messages sent to the publisher after they are created.
fn when_ready(&mut self) -> BoxFuture<'static, MessageSender<Message>>
[src]
Reserves a space for a message with the subscribers, returning when it's ready
fn when_empty(&mut self) -> BoxFuture<'static, ()>
[src]
Waits until all subscribers have consumed all pending messages
fn publish(&mut self, message: Self::Message) -> BoxFuture<'static, ()>
[src]
Auto Trait Implementations
impl<Message> RefUnwindSafe for SinglePublisher<Message>
impl<Message> Send for SinglePublisher<Message> where
Message: Send,
Message: Send,
impl<Message> Sync for SinglePublisher<Message> where
Message: Send,
Message: Send,
impl<Message> Unpin for SinglePublisher<Message>
impl<Message> UnwindSafe for SinglePublisher<Message>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,