scheduling

Crates.ioscheduling
lib.rsscheduling
version0.1.2
sourcesrc
created_at2020-06-10 17:09:54.434903
updated_at2020-06-11 15:10:13.720496
descriptionA simple job scheduler
homepage
repository
max_upload_size
id252436
size6,973
Jacob Brown (kardeiz)

documentation

http://docs.rs/scheduling

README

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

Commit count: 0

cargo fmt