taskwait

Runtime agnostic way of waiting for async tasks.

Features

Example

Using add & done

```rust use taskwait::TaskGroup;

let tg = TaskGroup::(); for _ in 0..10 { tg.add(1); let tgc = tg.clone(); tokio::spawn(async move{ ... tgc.done(); }) } tg.wait().await; ```

Using add & auto_work

```rust use taskwait::TaskGroup;

let tg = TaskGroup::(); for _ in 0..10 { tg.add(1); let work = tg.auto_work(); // Does not increment counter tokio::spawn(async move{ let _work = work; // done() will be called when this is dropped ... }) } tg.wait().await; ```

Using RAII based semantics

```rust use taskwait::TaskGroup;

let tg = TaskGroup::(); for _ in 0..10 { let work = tg.work(); // Increments the counter tokio::spawn(async move{ let _work = work; // done() will be called when this is dropped ... }) } tg.wait().await; ```