barrage

Crates.iobarrage
lib.rsbarrage
version0.2.3
sourcesrc
created_at2020-09-13 12:42:17.493096
updated_at2022-06-21 17:11:47.551652
descriptionAn async broadcast channel
homepage
repositoryhttps://github.com/Restioson/barrage
max_upload_size
id288169
size36,819
Restioson (Restioson)

documentation

https://docs.rs/barrage

README

barrage

A simple async broadcast channel. It is runtime agnostic and can be used from any executor. It can also operate synchronously.

Example

#[tokio::main]
async fn main() {
    let (tx, rx) = barrage::unbounded();
    let rx2 = rx.clone();
    tx.send_async("Hello!").await.unwrap();
    assert_eq!(rx.recv_async().await, Ok("Hello!"));
    assert_eq!(rx2.recv_async().await, Ok("Hello!"));
}
Commit count: 19

cargo fmt