Skip to main content

One post tagged with "async rust"

View All Tags

Counting, Signaling, and Cancelling: Choosing the Right Asyncband Primitive

· 5 min read
Nanami
Asyncband Contributor

This post is written against asyncband 0.7 (links point to the 0.7.3 docs); the crate is still pre-1.0, so later versions may require some adjustment.

Asyncband ships a wide box of coordination primitives: locks, channels, latches, pools. Wide enough that the daily question is rarely "how do I use X" but "which X is this job". This post walks the three you will reach for most often — Semaphore, ManualResetEvent, and AutoResetEvent — through one question: what is the unit of coordination? A permit to count, a level to observe, or an edge to consume.