Runtime independent broadcast, which only polls it's underlying stream if no pending data is available. ```rust use futures::StreamExt; use stream_broadcast::StreamBroadcastExt;
async fn main() {
let broadcast = futures::stream::iter(0..4).broadcast(3);
let broadcast2 = broadcast.clone();
asserteq!(4, broadcast.count().await);
// Number Zero wasn't available anymore due to BroadcastSize=3
asserteq!(vec![(1, 1), (0,2), (0,3)], broadcast2.collect::
Uses
#![forbid(unsafe_code)]`
sharedstream: - Caches the entire stream from start, which is not practical for big datasets. This crate streams from the same position where the clone-origin is currently at - sharedstream never skips an entry. This library only provides information about missing data - High risk of leaking memory
tokio::sync::broadcast: - Broacasts don't implement Stream directly, but tokiostream provides a wrapper. - Entries are pushed actively to the sender (No Lazy evaluation when stream is paused). This requires a subroutine, which has to be managed somehow. - Instead of returning missing frames in the ErrorVariant (tokiostream), this library returns a tuple (missingframessincelastframe, TData) to mitigate errors when doing stuff like stream.count()