funscheduler

Crates.iofunscheduler
lib.rsfunscheduler
version0.1.0
sourcesrc
created_at2021-10-29 09:38:44.75741
updated_at2021-10-29 09:38:44.75741
descriptionTime based function execution scheduler
homepagehttps://github.com/cy6erlion/funscheduler
repositoryhttps://github.com/cy6erlion/funscheduler
max_upload_size
id473876
size5,196
(cy6erlion)

documentation

README

┌─┐┬ ┬┌┐┌┌─┐┌─┐┬ ┬┌─┐┌┬┐┬ ┬┬  ┌─┐┬─┐
├┤ │ ││││└─┐│  ├─┤├┤  │││ ││  ├┤ ├┬┘
└  └─┘┘└┘└─┘└─┘┴ ┴└─┘─┴┘└─┘┴─┘└─┘┴└─

Time based function execution scheduler

use funscheduler::{FunScheduler, Timing};

fn main() {
    // Execute job every five seconds
    FunScheduler::interval(job, Timing::Seconds(5));
}

fn job() {
    println!("Hello, world");
}

Time configurations with the Timing Enum

Timing::Seconds(1)
Timing::Minutes(25)
Timing::Hours(2)
Timing::Days(1)

Job runners, different methods to execute the function

// Evaluates a function at specified intervals, starting now
FunScheduler::interval(job, Timing::Seconds(1))

// Evaluates a function at specified intervals, does not execute
// the function immedialy
FunScheduler::rinterval(job, Timing::Seconds(1))

// Execute function once after a specified amount of time
FunScheduler::after(job, Timing::Seconds(1))

Commit count: 27

cargo fmt