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.
run_metered runs an isolated task and waits for its result, while
spawn_metered starts the same task without waiting. Both provide panic
recovery and service.task.* metric emission.
Structs§
- Concurrency
Limiter - Limits concurrent backend operations and tracks in-flight count.
- Concurrency
Permit - RAII guard for a concurrency permit.
- Stats
- Snapshot of concurrency limiter state.
Functions§
- run_
metered - Runs a future on a dedicated task with panic isolation and timing metrics.
- spawn_
metered - Spawns a metered future without waiting for its result.