waitgroup

Crates.iowaitgroup
lib.rswaitgroup
version0.1.2
sourcesrc
created_at2020-02-28 16:04:47.321076
updated_at2020-10-08 09:19:59.803882
descriptionAsync waitgroup for a collection of task to finish
homepagehttps://github.com/laizy/waitgroup-rs
repositoryhttps://github.com/laizy/waitgroup-rs
max_upload_size
id213570
size16,280
(laizy)

documentation

https://docs.rs/waitgroup

README

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 ).

Commit count: 9

cargo fmt