postage 0.5.0

An async channel library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use postage::{mpsc, prelude::Stream, sink::Sink};

#[async_std::main]
async fn main() {
    let (mut tx, mut rx) = mpsc::channel(8);

    async_std::task::spawn(async move {
        tx.send("Hello".to_string()).await.ok();
        tx.send("World".to_string()).await.ok();
    });

    while let Some(message) = rx.recv().await {
        println!("Sender says {}", message)
    }
}