Struct flo_stream::WeakPublisher [−][src]
pub struct WeakPublisher<Message> { /* fields omitted */ }
Expand description
A weak publisher republishes a Publisher
only so long as that Publisher
exists.
This type of publisher can be created by calling republish_weak()
on a Publisher
. The subscribers will close if the
Publisher
is released even if the WeakPublisher
still exists.
This is useful as a way to send messages to a stream without ‘owning’ it, where it’s acceptable for the messages to be dropped once the target has gone away (eg: messages to a window in a user interface might not longer be relevant once the window has closed)
Implementations
Counts the number of subscribers in this publisher
Trait Implementations
Subscribes to this publisher
Subscribers only receive messages sent to the publisher after they are created.
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