TDesu.FSharp.Concurrency Namespace
Concurrency primitives: AtomicInt/Int64, BoundedDict, BoundedQueue, Signal, PeriodicTimer, ChannelWorker, SlidingWindowLimiter.
| Type/Module | Description |
|
Thread-safe atomic counter using Interlocked. Zero-allocation reads. |
|
|
Thread-safe atomic int64 counter. The initial counter value. |
|
|
Bounded dictionary — auto-evicts the first-inserted key when capacity is reached. Not thread-safe. |
|
|
Bounded queue — auto-evicts oldest elements when capacity is reached. Not thread-safe. |
|
|
CancellationToken helpers — reduces boilerplate for timeout + linked patterns. |
|
|
Generic background worker that processes items sequentially from an internal queue. Fault-tolerant: errors in handlers are reported via callback without crashing the worker. Stops gracefully on cancellation. |
|
|
Periodic background timer — runs an action at fixed intervals with cancellation. |
|
|
One-shot async signal. Wraps TaskCompletionSource{T} for idiomatic F# async coordination. |
|
|
Sliding-window rate limiter. Tracks request count within a time window. Thread-safe on .NET; single-threaded safe on Fable. |
|
|
Snapshot throttle — tracks message count and triggers save at threshold (thread-safe). |
TDesu.FSharp