#future #wake #async

waitgroup

Async waitgroup for a collection of task to finish

3 releases

0.1.2 Oct 8, 2020
0.1.1 Apr 14, 2020
0.1.0 Feb 28, 2020

#871 in Asynchronous

Download history 29031/week @ 2025-12-30 47657/week @ 2026-01-06 56122/week @ 2026-01-13 57905/week @ 2026-01-20 58501/week @ 2026-01-27 66425/week @ 2026-02-03 53370/week @ 2026-02-10 62605/week @ 2026-02-17 67651/week @ 2026-02-24 75474/week @ 2026-03-03 76450/week @ 2026-03-10 67784/week @ 2026-03-17 71868/week @ 2026-03-24 71777/week @ 2026-03-31 68334/week @ 2026-04-07 67593/week @ 2026-04-14

291,130 downloads per month
Used in 167 crates (16 directly)

Apache-2.0

7KB
75 lines

waitgroup

A WaitGroup waits for a collection of task to finish.

Examples

use waitgroup::WaitGroup;
use async_std::task;
async {
	let wg = WaitGroup::new();
	for _ in 0..100 {
		let w = wg.worker();
		task::spawn(async move {
			// do work
			drop(w); // drop w means task finished
		};
	}

	wg.wait().await;
}

License

This project is licensed under Apache License, Version 2.0 (LICENSE ).

Dependencies

~19KB