[][src]Crate broadcaster

broadcaster provides a wrapper for any Stream and Sink implementing the mpsc pattern to enable broadcasting items. This means that any item sent will be received by every receiver, not just the first to check (like most mpmc streams). As an example:

use broadcaster::BroadcastChannel;

use futures_util::StreamExt;

let mut chan = BroadcastChannel::new();
assert_eq!(chan.next().await, Some(5));

let mut chan2 = chan.clone();
assert_eq!(chan.next().await, Some(6));
assert_eq!(chan2.next().await, Some(6));



A broadcast channel, wrapping any clonable Stream and Sink to have every message sent to every receiver.