Registry / async / async-channel

async-channel

JSON →
library2.5.0rscratesunverified

Async multi-producer multi-consumer channel for Rust's async ecosystem.

# Cargo.toml [dependencies] async-channel = "2.5.0"
INSTALL
IMPORT
SIG · ASYNC-CHANNEL
A
async-channel
asyncrustv2.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Receiver
use async_channel::Receiver;

Creates an unbounded async channel, sends a value, and receives it.

use async_channel::{unbounded, Receiver}; #[tokio::main] async fn main() { let (s, r): (_, Receiver<i32>) = unbounded(); s.send(42).await.unwrap(); let val = r.recv().await.unwrap(); println!("{}", val); }
Debug
Known issues
gotchaRequires an async runtime (e.g., tokio, async-std) to execute.
fix
Add a runtime dependency and annotate main with #[tokio::main] or similar.
affects: >=2.0.0
Upgrade
Version history
2.5.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
58 hits · last 30 days
node
52
Resources
async-channel — cargo add async-channel · libregistry