{"id":28237237,"url":"https://github.com/just-do-halee/wag","last_synced_at":"2025-06-10T15:30:30.119Z","repository":{"id":64222395,"uuid":"574208665","full_name":"just-do-halee/wag","owner":"just-do-halee","description":"Go like sync.WaitGroup implementation in Rust. (sync/async)","archived":false,"fork":false,"pushed_at":"2022-12-06T06:00:25.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T17:21:17.245Z","etag":null,"topics":["async","rust","rust-library","sync","waitgroup"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/just-do-halee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["just-do-halee"]}},"created_at":"2022-12-04T18:55:27.000Z","updated_at":"2022-12-15T01:34:25.000Z","dependencies_parsed_at":"2023-01-23T14:46:04.935Z","dependency_job_id":null,"html_url":"https://github.com/just-do-halee/wag","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Fwag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Fwag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Fwag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Fwag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/just-do-halee","download_url":"https://codeload.github.com/just-do-halee/wag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Fwag/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259100991,"owners_count":22805182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","rust","rust-library","sync","waitgroup"],"created_at":"2025-05-19T00:17:54.302Z","updated_at":"2025-06-10T15:30:30.107Z","avatar_url":"https://github.com/just-do-halee.png","language":"Rust","funding_links":["https://github.com/sponsors/just-do-halee"],"categories":[],"sub_categories":[],"readme":"# **`WAG`**\n\nGo like sync.WaitGroup implementation in Rust. (sync/async)\n\n[![CI][ci-badge]][ci-url]\n[![Crates.io][crates-badge]][crates-url]\n[![Licensed][license-badge]][license-url]\n[![Twitter][twitter-badge]][twitter-url]\n\n[ci-badge]: https://github.com/just-do-halee/wag/actions/workflows/ci.yml/badge.svg\n[crates-badge]: https://img.shields.io/crates/v/wag.svg?labelColor=383636\n[license-badge]: https://img.shields.io/crates/l/wag?labelColor=383636\n[twitter-badge]: https://img.shields.io/twitter/follow/do_halee?style=flat\u0026logo=twitter\u0026color=4a4646\u0026labelColor=333131\u0026label=just-do-halee\n[ci-url]: https://github.com/just-do-halee/wag/actions\n[twitter-url]: https://twitter.com/do_halee\n[crates-url]: https://crates.io/crates/wag\n[license-url]: https://github.com/just-do-halee/wag\n\n| [Examples](./tests/) | [Docs](https://docs.rs/wag) | [Latest Note](./CHANGELOG.md) |\n\n```toml\nwag = \"0.3.0\"\n```\n\n## **`How to use,`**\n\n```rust\nuse wag::WaitGroup;\n\nlet wg = WaitGroup::new();\n```\n\n```rust\nfor _ in 0..10 {\n    let w = wg.add();\n\n    thread::spawn(move || {\n        // ...\n        w.done();\n    });\n\n});\nwg.wait(); // or wg.async_wait().await;\n```\n\n```rust\nfor w in wg.adds::\u003c10\u003e() {\n\n    thread::spawn(move || {\n        // ...\n        w.done();\n    });\n\n});\nwg.wait(); // or wg.async_wait().await;\n```\n\n```rust\nlet [w1, w2, w3] = wg.adds();\n\nthread::spawn(move || {\n    // ...\n    w1.done();\n});\n\nthread::spawn(move || {\n    // ...\n    w2.done();\n});\n\nthread::spawn(move || {\n    // ...\n    w3.done();\n});\n\nwg.wait(); // or wg.async_wait().await;\n```\n\n```rust\nwg.adds_iter::\u003c10\u003e().enumerate().for_each(|(i, w)| {\n\n    thread::spawn(move || {\n        // ... with i\n        w.done();\n    });\n\n});\nwg.wait(); // or wg.async_wait().await;\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust-do-halee%2Fwag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjust-do-halee%2Fwag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust-do-halee%2Fwag/lists"}