wait-counter

Crates.iowait-counter
lib.rswait-counter
version0.1.2
created_at2025-03-13 16:17:38.22888+00
updated_at2025-03-13 16:22:51.588031+00
descriptionA counter allow you to wait, and return when it reach 1
homepage
repository
max_upload_size
id1591059
size21,831
iHsin (Itsusinn)

documentation

README

wait-counter

let counter = WaitCounter::new();
let cloned = counter.clone();
tokio::spawn(async move {
    // After simulating time-consuming operations, drop the cloned instance
    tokio::time::sleep(Duration::from_millis(1000)).await;
    drop(cloned);
});

counter.wait().await;
println!("Counter reached 1");
Commit count: 0

cargo fmt