Skip to main content

Module concurrency

Module concurrency 

Source
Expand description

Concurrency limiter for backend operations.

ConcurrencyLimiter caps the number of in-flight backend operations using a tokio semaphore. Each acquired ConcurrencyPermit notifies waiters on drop, allowing ConcurrencyLimiter::wait_all to resolve once all permits have been returned.

spawn_metered spawns an arbitrary future as an isolated task with panic recovery and service.task.* metric emission.

Structs§

ConcurrencyLimiter
Limits concurrent backend operations and tracks in-flight count.
ConcurrencyPermit
RAII guard for a concurrency permit.
Stats
Snapshot of concurrency limiter state.

Functions§

spawn_metered
Spawns a future on a dedicated task with panic isolation and timing metrics.