scheduling 0.1.2

A simple job scheduler
Documentation
  • Coverage
  • 90.91%
    10 out of 11 items documented1 out of 10 items with examples
  • Size
  • Source code size: 6.44 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.57 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Documentation
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kardeiz

scheduling

A very simple job scheduler. Runs one job (one-time or recurring) on one spawned thread.

Usage

fn main() {
    let _once_handle = scheduling::Scheduler::once(|| println!("ONCE")).start();

    let recurring_handle = scheduling::Scheduler::delayed_recurring(
        std::time::Duration::from_secs(1),
        std::time::Duration::from_secs(1),
        || println!("1 SEC ELAPSED"),
    )
    .start();

    std::thread::sleep(std::time::Duration::from_secs(5));

    recurring_handle.cancel();

    std::thread::sleep(std::time::Duration::from_secs(5));
}

License: MIT