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
  • 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