Skip to content

leo60228/broadcaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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();
chan.send(&5i32).await?;
assert_eq!(chan.next().await, Some(5));

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages