Crates.io | await-group |
lib.rs | await-group |
version | 0.1.0 |
source | src |
created_at | 2023-05-23 16:31:49.365331 |
updated_at | 2023-05-23 16:31:49.365331 |
description | Golang like WaitGroup implementation |
homepage | |
repository | https://github.com/Millione/await-group |
max_upload_size | |
id | 872152 |
size | 18,148 |
Golang like WaitGroup implementation.
Add this to your Cargo.toml
:
[build-dependencies]
await-group = "0.1"
use await_group::AwaitGroup;
#[tokio::main]
async fn main() {
let wg = AwaitGroup::new();
for _ in 0..10 {
let w = wg.clone();
tokio::spawn(async move {
_ = w;
});
}
wg.await;
}
Dual-licensed under the MIT license and the Apache License (Version 2.0).
See LICENSE-MIT and LICENSE-APACHE for details.