rider 0.1.2

bounded executor for tokio; limit the count of tasks running 🚦
Documentation
  • Coverage
  • 100%
    7 out of 7 items documented4 out of 5 items with examples
  • Size
  • Source code size: 43.42 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.6 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • old-redcloudvg/rider
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • priv2024

rider

License Cargo Documentation

bounded executor for tokio; limit the count of tasks running

use rider::{Rider, RiderError};

#[tokio::main]
async fn main() -> Result<(), RiderError> {
    // create an executor that allows at most 10 task running concurrently
    let rider = Rider::new(10);

    for index in 0..10000 {
        rider
            .spawn(async move {
                println!("{}", index);
            })
            .await?; // Suspends until task is spawned
    }

    // Deny further tasks and join remaining tasks
    rider.shutdown().await;
}