#wait-group #notify #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

#420 in Asynchronous

Download history 8977/week @ 2025-01-01 10928/week @ 2025-01-08 10668/week @ 2025-01-15 10184/week @ 2025-01-22 11873/week @ 2025-01-29 11910/week @ 2025-02-05 9466/week @ 2025-02-12 14873/week @ 2025-02-19 16023/week @ 2025-02-26 12641/week @ 2025-03-05 12054/week @ 2025-03-12 13752/week @ 2025-03-19 14119/week @ 2025-03-26 12311/week @ 2025-04-02 14215/week @ 2025-04-09 10582/week @ 2025-04-16

53,350 downloads per month
Used in 100 crates (14 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

~21KB