await-group

Crates.ioawait-group
lib.rsawait-group
version0.1.0
sourcesrc
created_at2023-05-23 16:31:49.365331
updated_at2023-05-23 16:31:49.365331
descriptionGolang like WaitGroup implementation
homepage
repositoryhttps://github.com/Millione/await-group
max_upload_size
id872152
size18,148
LIU JIE (Millione)

documentation

https://docs.rs/await-group/

README

await-group

Crates.io License Build Status

Golang like WaitGroup implementation.

Usage

Add this to your Cargo.toml:

[build-dependencies]
await-group = "0.1"

Example

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;
}

License

Dual-licensed under the MIT license and the Apache License (Version 2.0).

See LICENSE-MIT and LICENSE-APACHE for details.

Commit count: 3

cargo fmt