Sync
Semaphore#
Semaphore is commonly used for limiting max concurrency, e.g. limiting max number of concurrent connections.
Use
Benchmark
Keyed-Semaphores#
Commonly used for limiting max concurrency per key, e.g. limiting max number of concurrent connections per client.
Generic Concurrency-Safe Map#
Generic version of std sync.Map.
Import
API:
CompareAndDelete, CompareAndSwap, Delete, Load, LoadAndDelete, LoadOrStore, Range, Store, Swap
Sample:
map
↗
Generic Concurrency-Safe Set#
Implemented based on std sync.Map.
Import
API:
Add, Delete, Len, Contain, Range, Replace
Sample:
set
↗