Skip to main content

Module async_utils

Module async_utils 

Source
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

TypeDescription
SemaphoreCounting semaphore — controls concurrent access to a resource pool.
TokenBucketRateLimiterToken-bucket rate limiter; threads block until a token is available.
RetryPolicyConfigurable retry with exponential back-off and jitter.
FutureExecutorSimple concurrent future executor using a fixed thread pool.

Structs§

FutureExecutor
A simple concurrent future executor backed by a fixed thread pool.
JoinFuture
A handle to a spawned future. Call join to block until the value is ready.
RetryPolicy
Configurable retry policy with back-off.
Semaphore
A counting semaphore.
SemaphoreGuard
An RAII guard that releases a semaphore permit when dropped.
TokenBucketRateLimiter
Token-bucket rate limiter.

Enums§

BackoffStrategy
Back-off strategy for retries.