Crate awaitdrop

Crate awaitdrop 

Source
Expand description

Yet another WaitGroup implementation.

None of the existing crates fit my needs exactly, so here’s one more that (hopefully) will.

Highlights:

  • Generalizes “tasks” to Refs. More of a change in nomenclature than anything else. It’s not always a group of tasks you’re waiting on - it could be that you’re waiting on a gaggle of structs to all be dropped.
  • Refs and Waiters are entirely disjoint. You don’t need a Waiter to create a new Ref.
  • Everything is cloneable and behaves as one would expect - cloned Refs will all block every cloned Waiter, which can be awaited concurrently.

Structs§

Ref
A reference whose drop can be awaited
WaitFuture
The future returned from Waiter::wait
Waiter
An awaitable handle to some number of references that will eventually be dropped
Weak
A reference whose drop can be awaited

Functions§

awaitdrop
Create a new Ref and Waiter