Crate chunnel

Source
Expand description

§Chunnel

Async mpmc(multi producer multi consumer) channel.

§Usage

This crate provides an async version of the mpmc channel, similar to std::sync::mpmc or crossbeam_channel.

Example code:

use chunnel::mpmc::bounded::bounded;
#[tokio::main]
async fn main() {
    let (sender, receiver) = bounded::<i32, 16>();

    tokio::spawn(async move {
        for i in 0..10 {
            sender.send(i).await.unwrap();
        }
    });

    let _ = receiver.recv().await.unwrap();
}

§Cargo.toml

[dependencies]
chunnel = "0.1"

Modules§

mpmc
An async MPMC channel.