An open API service indexing awesome lists of open source software.

https://github.com/al8n/wg

Golang like WaitGroup implementation for sync/async Rust, support no_std environment.
https://github.com/al8n/wg

async async-std async-wait concurrency no-std patterns rust smol tokio waitgroup

Last synced: 6 months ago
JSON representation

Golang like WaitGroup implementation for sync/async Rust, support no_std environment.

Awesome Lists containing this project

README

          


wg



Golang like WaitGroup implementation for sync/async Rust, support `no_std` environment.

[github][Github-url]
[Build][CI-url]
[codecov][codecov-url]

[docs.rs][doc-url]
[crates.io][crates-url]
[crates.io][crates-url]

license

## Introduction

By default, blocking version `WaitGroup` is enabled.

If you are using other async runtime, you need to
enbale `future` feature in your `Cargo.toml` and use `wg::AsyncWaitGroup`.

## Installation

- std

```toml
[dependencies]
wg = "0.9"
```

- `future`

```toml
[dependencies]
wg = { version = "0.9", features = ["future"] }
```

- no_std

```toml
[dependencies]
wg = { version = "0.9", default_features = false, features = ["alloc"] }
```

- no_std & future

```toml
[dependencies]
wg = { version = "0.9", default_features = false, features = ["alloc", "future"] }
```

## Examples

Please see [examples](./examples) for details.

## Acknowledgements

- Inspired by Golang sync.WaitGroup and [`crossbeam_utils::WaitGroup`].

## License


Licensed under either of Apache License, Version
2.0
or MIT license at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this project by you, as defined in the Apache-2.0 license,
shall be dual licensed as above, without any additional terms or conditions.

[ibraheemdev's `AwaitGroup`]: https://github.com/ibraheemdev/awaitgroup
[`crossbeam_utils::WaitGroup`]: https://docs.rs/crossbeam/0.8.1/crossbeam/sync/struct.WaitGroup.html
[Github-url]: https://github.com/al8n/wg/
[CI-url]: https://github.com/al8n/wg/actions/workflows/ci.yml
[doc-url]: https://docs.rs/wg
[crates-url]: https://crates.io/crates/wg
[codecov-url]: https://app.codecov.io/gh/al8n/wg/