wait-counter 0.1.2

A counter allow you to wait, and return when it reach 1
Documentation
  • Coverage
  • 0%
    0 out of 5 items documented0 out of 4 items with examples
  • Size
  • Source code size: 21.34 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 283.94 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Itsusinn

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");