Skip to main content

Module sync

Module sync 

Source
Expand description

Synchronisation primitives for async tasks.

All primitives are async-aware: waiting tasks yield back to the executor instead of blocking the OS thread.

PrimitiveModuleDescription
mpscmpscMulti-producer single-consumer channel (bounded + unbounded)
oneshotoneshotSend exactly one value; Receiver is a Future
MutexmutexAsync mutex with FIFO waiter queue

Re-exports§

pub use mutex::Mutex;
pub use mutex::MutexGuard;
pub use oneshot::RecvError;

Modules§

mpsc
Multi-producer single-consumer (MPSC) channel.
mutex
Async mutex — cooperative mutual exclusion for async tasks.
oneshot
One-shot channel — send exactly one value from producer to consumer.