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.
- Host: GitHub
- URL: https://github.com/al8n/wg
- Owner: al8n
- License: apache-2.0
- Created: 2021-10-24T15:57:12.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-06T20:11:43.000Z (about 1 year ago)
- Last Synced: 2024-10-06T20:49:47.215Z (about 1 year ago)
- Topics: async, async-std, async-wait, concurrency, no-std, patterns, rust, smol, tokio, waitgroup
- Language: Rust
- Homepage:
- Size: 74.2 KB
- Stars: 32
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
wg
Golang like WaitGroup implementation for sync/async Rust, support `no_std` environment.
[
][Github-url]
[][CI-url]
[][codecov-url]
[
][doc-url]
[][crates-url]
[][crates-url]
![]()
## 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/