Go like sync.WaitGroup implementation in Rust. (sync/async)

Overview

WAG

Go like sync.WaitGroup implementation in Rust. (sync/async)

CI Crates.io Licensed Twitter

| Examples | Docs | Latest Note |

wag = "0.3.0"

How to use,

use wag::WaitGroup;

let wg = WaitGroup::new();
for _ in 0..10 {
    let w = wg.add();

    thread::spawn(move || {
        // ...
        w.done();
    });

});
wg.wait(); // or wg.async_wait().await;
for w in wg.adds::<10>() {

    thread::spawn(move || {
        // ...
        w.done();
    });

});
wg.wait(); // or wg.async_wait().await;
let [w1, w2, w3] = wg.adds();

thread::spawn(move || {
    // ...
    w1.done();
});

thread::spawn(move || {
    // ...
    w2.done();
});

thread::spawn(move || {
    // ...
    w3.done();
});

wg.wait(); // or wg.async_wait().await;
wg.adds_iter::<10>().enumerate().for_each(|(i, w)| {

    thread::spawn(move || {
        // ... with i
        w.done();
    });

});
wg.wait(); // or wg.async_wait().await;
You might also like...
Automatically deleted async I/O temporary files in Rust

async-tempfile Provides the TempFile struct, an asynchronous wrapper based on tokio::fs for temporary files that will be automatically deleted when th

An async Rust client for SurrealDB's RPC endpoint

An async Rust client for SurrealDB's RPC endpoint This crate serves as a temporary yet complete implementation of an async Rust client to connect to a

An async-ready Phoenix Channels v2 client library in Rust

Phoenix Channels This crate implements a Phoenix Channels (v2) client in Rust. Status NOTE: This client is still a work-in-progress, though it has eno

Notification demon + web server using async Rust
Notification demon + web server using async Rust

Async Rust example Road to the asynchronous Rust Table of Contents About the Project Screenshots Tech Stack Features Getting Started Prerequisites Clo

Lightweight async Redis client with connection pooling written in pure Rust and 100% memory safe
Lightweight async Redis client with connection pooling written in pure Rust and 100% memory safe

redi-rs (or redirs) redi-rs is a Lightweight Redis client with connection pooling written in Rust and 100% memory safe redi-rs is a Redis client writt

An async executor based on the Win32 thread pool API

wae An async executor based on the Win32 thread pool API use futures::channel::oneshot; #[wae::main] async fn main() { let (tx, rx) = oneshot::ch

Async positioned I/O with io_uring.

uring-positioned-io Fully asynchronized positioned I/O with io_uring. Basic Usage let files = vec![File::open("test.txt").unwrap()]; let context = Uri

An Async SDR Runtime for Heterogeneous Architectures

FutureSDR An experimental asynchronous SDR runtime for heterogeneous architectures that is: Extensible: custom buffers (supporting accelerators like G

Macros that allow for implicit await in your async code.

suspend fn Disclaimer: this was mostly made as a proof of concept for the proposal below. I haven't tested if there is a performance cost to this macr

Releases(v0.3.0)
Owner
Doha Lee
I will change the world.
Doha Lee
📺 Netflix in Rust/ React-TS/ NextJS, Actix-Web, Async Apollo-GraphQl, Cassandra/ ScyllaDB, Async SQLx, Kafka, Redis, Tokio, Actix, Elasticsearch, Influxdb Iox, Tensorflow, AWS

Fullstack Movie Streaming Platform ?? Netflix in RUST/ NextJS, Actix-Web, Async Apollo-GraphQl, Cassandra/ ScyllaDB, Async SQLx, Spark, Kafka, Redis,

null 34 Apr 17, 2023
Dataloader-rs - Rust implementation of Facebook's DataLoader using async-await.

Dataloader Rust implementation of Facebook's DataLoader using async-await. Documentation Features Batching load requests with caching Batching load re

cksac 229 Nov 27, 2022
Diesel async connection implementation

A async interface for diesel Diesel gets rid of the boilerplate for database interaction and eliminates runtime errors without sacrificing performance

Georg Semmler 293 Dec 26, 2022
🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, SQLite, and MSSQL.

SQLx ?? The Rust SQL Toolkit Install | Usage | Docs Built with ❤️ by The LaunchBadge team SQLx is an async, pure Rust† SQL crate featuring compile-tim

launchbadge 7.6k Dec 31, 2022
TDS 7.2+ (mssql / Microsoft SQL Server) async driver for rust

Tiberius A native Microsoft SQL Server (TDS) client for Rust. Supported SQL Server versions Version Support level Notes 2019 Tested on CI 2017 Tested

Prisma 189 Dec 25, 2022
Simple, async embedded Rust

Cntrlr - Simple, asynchronous embedded Cntrlr is an all-in-one embedded platform for writing simple asynchronous applications on top of common hobbyis

Branan Riley 11 Jun 3, 2021
Rust async runtime based on io-uring.

Monoio A thread-per-core Rust runtime with io_uring. 中文说明 Design Goal As a runtime based on io_uring, Monoio is designed to be the most efficient and

Bytedance Inc. 2.4k Jan 6, 2023
🐚 An async & dynamic ORM for Rust

SeaORM ?? An async & dynamic ORM for Rust SeaORM SeaORM is a relational ORM to help you build web services in Rust with the familiarity of dynamic lan

SeaQL 3.5k Jan 6, 2023
Quick Pool: High Performance Rust Async Resource Pool

Quick Pool High Performance Rust Async Resource Pool Usage DBCP Database Backend Adapter Version PostgreSQL tokio-postgres qp-postgres Example use asy

Seungjae Park 13 Aug 23, 2022
High-level async Cassandra client written in 100% Rust.

CDRS tokio CDRS is production-ready Apache Cassandra driver written in pure Rust. Focuses on providing high level of configurability to suit most use

Kamil Rojewski 73 Dec 26, 2022