Expand description
Thread-based async-style concurrency utilities.
This module provides concurrency primitives that mirror the semantics of async libraries (semaphore, rate limiter, retry) but are implemented entirely with OS threads and standard synchronisation primitives — no async/await runtime required.
§Primitives
| Type | Description |
|---|---|
Semaphore | Counting semaphore — controls concurrent access to a resource pool. |
TokenBucketRateLimiter | Token-bucket rate limiter; threads block until a token is available. |
RetryPolicy | Configurable retry with exponential back-off and jitter. |
FutureExecutor | Simple concurrent future executor using a fixed thread pool. |
Structs§
- Future
Executor - A simple concurrent future executor backed by a fixed thread pool.
- Join
Future - A handle to a spawned future. Call
jointo block until the value is ready. - Retry
Policy - Configurable retry policy with back-off.
- Semaphore
- A counting semaphore.
- Semaphore
Guard - An RAII guard that releases a semaphore permit when dropped.
- Token
Bucket Rate Limiter - Token-bucket rate limiter.
Enums§
- Backoff
Strategy - Back-off strategy for retries.