An open API service indexing awesome lists of open source software.

https://github.com/restioson/barrage

A simple async broadcast channel
https://github.com/restioson/barrage

Last synced: 8 months ago
JSON representation

A simple async broadcast channel

Awesome Lists containing this project

README

          

# barrage

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

## Example

```rust
#[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!"));
}
```