Coordinates query and ingestion admission budgets, pools backend connections, and drains active workloads gracefully during node shutdown.
Shares concurrency budgets across storage operators and coalesces concurrent remote directory creation without coupling backends to one executor.
Deduplicates overlapping cloud credential and delegation-key refreshes across concurrent HTTP signing callers while keeping signing crates runtime-neutral.

Git hook runnerPasses shared concurrency permits across workspace project runs to bound parallel hook execution against local CPU and I/O capacity.
Mechanism in the library. Policy in your code.
Reusable concurrency mechanisms belong in a shared crate; task scheduling, timers, retries, and lifecycle policy belong to the application.
Executor-independent by construction
Built strictly on core::future::Future and core::task::Waker. Works seamlessly on Tokio as well as custom schedulers or embedded executors, without spawning tasks, owning threads, or installing timers.
Mechanism in the library, policy in the caller
Stateful coordination such as singleflight groups and object pools fit cleanly, while task placement, deadlines, retries, and periodic maintenance stay with your runtime.
Zero-default feature granularity
The crate enables no APIs by default. Opt into individual features like mutex, semaphore, or mpsc so unused primitives and optional dependencies stay out of your build.
Async first, synchronous at the boundary
Primitives optimize for async waker queues rather than duplicating blocking methods across every type. Synchronous callers drive futures at the boundary via blocking::FutureExt.
Choose the exact coordination contract.
Subtle concurrency bugs happen when one primitive stands in for another: retaining a value vs. collapsing overlapping calls, or dropping slow receivers vs. applying sender backpressure.
use std::sync::Arc;
use asyncband::semaphore::{OwnedSemaphorePermit, Semaphore};
pub struct TrackedStream<S> {
inner: S,
_permit: OwnedSemaphorePermit,
}
pub async fn open_stream<S>(
slots: &Arc<Semaphore>,
connect: impl AsyncFnOnce() -> S,
) -> TrackedStream<S> {
let permit = slots.clone().acquire_owned(1).await;
TrackedStream {
inner: connect().await,
_permit: permit,
}
}
26 primitives across 6 families.
Public module paths stay direct while Cargo features keep unused implementations out of your build. Select any entry to open its API reference on docs.rs.
Locks and conditions
4 APIsmutexProtect shared data with asynchronous mutual exclusion.
rwlockAllow multiple concurrent readers or one exclusive writer.
rwlockAllow multiple readers or one writer, with one upgradable reader.
condvarWait for notifications while atomically releasing an async mutex.
Coordination
8 APIssemaphoreLimit concurrent work and charge resource budgets by acquiring permits.
barrierSynchronize a fixed number of participants at a reusable rendezvous.
eventSignal current and future waits until explicitly reset.
eventRetain one signal and release one waiter per consumed signal.
latchWait until a fixed one-way countdown reaches zero.
phaserCoordinate repeated phases across a dynamic participant set.
waitgroupDynamically register participants and wait until all have completed.
shutdownRequest shutdown and wait until all completion guards are dropped.
Work coalescing
5 APIsonceComplete one asynchronous initialization; cancelled or panicked attempts may be retried.
once-cellStore one value from an access-time initializer; failed or cancelled attempts may be retried.
lazy-cellInitialize one value with a stored function and resume the in-flight future across cancellation.
once-mapCoalesce work per key and retain each successful value until explicitly removed.
singleflightCoalesce overlapping work per key without retaining completed values.
Communication
7 APIscompletionPublish one shared result to any number of current and late observers.
oneshotSend one value from one sender to one receiver.
mpmcDistribute each value to exactly one of multiple competing receivers.
mpscSend values from multiple producers to one receiver with bounded or unbounded queues.
spmcDistribute work from one exclusive sender to multiple competing receivers.
broadcastDeliver every value to active receivers with bounded backpressure or unbounded retention.
watchPublish cloneable latest state; receivers independently coalesce intermediate updates.
Single-future boundary adapter
blocking::FutureExt parks the calling thread for one runtime-agnostic future. wait_timeout drops the future on timeout; futures needing a timer or I/O driver still require their runtime, and executor threads must not block.
blocking contract →Conditional Send and Sync
Asyncband types implement Send and Sync only when the protected, transferred, or managed value satisfies the required trait bounds, preserving use with non-Send local state where sound.
API reference →MSRV 1.86.0 · Minor-bump policy
Built and tested against stable Rust with a minimum supported rustc of 1.86.0. Patch releases (x.y.z) preserve the MSRV; increases happen only in minor or major updates.
Field guides and migration notes.
Practical write-ups on choosing concurrency contracts, migrating from tokio::sync or mea, and composing primitives in production.
Moving from tokio::sync to Apache Asyncband
How channel backpressure, semaphore permits, event notifications, and initialization contracts differ when switching primitives on Tokio.
Read guide →Workload control · SemaphoreUsing Semaphores to Control In-Flight Work
Share concurrency budgets across callers, tie OwnedSemaphorePermit to stream lifetimes, and charge capacity by payload size.
Read guide →Deduplication · Singleflight & OnceCoalescing Concurrent Work with Singleflight
Collapse duplicate key refreshes with singleflight::Group, handle cancellation and errors, and compare against OnceMap and LazyCell.
Read guide →Crate rename · MEAMigrating from the mea crate
Asyncband was formerly published as mea. Follow the step-by-step rename and feature flag checklist for existing Rust workspaces.
Read guide →Add only the primitives you need.
Apache Asyncband (Incubating) 0.8.0 ships as a verified ASF source release and on crates.io for Rust 1.86.0 and newer.