#golang

await-group

Golang like WaitGroup implementation

1 unstable release

0.1.0 May 23, 2023

#65 in #golang

MIT/Apache

8KB
69 lines

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.

Dependencies

~21KB