chunnel

Crates.iochunnel
lib.rschunnel
version0.1.0
created_at2025-01-21 13:03:22.777773+00
updated_at2025-01-21 13:03:22.777773+00
descriptionAsync mpmc(multi producer multi consumer) channel
homepage
repositoryhttps://github.com/mox692/chunnel
max_upload_size
id1524880
size73,180
Motoyuki Kimura (mox692)

documentation

README

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"
Commit count: 51

cargo fmt