funscheduler 0.1.0

Time based function execution scheduler
Documentation
  • Coverage
  • 60%
    6 out of 10 items documented0 out of 5 items with examples
  • Size
  • Source code size: 5.19 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 315.49 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • cy6erlion
┌─┐┬ ┬┌┐┌┌─┐┌─┐┬ ┬┌─┐┌┬┐┬ ┬┬  ┌─┐┬─┐
├┤ │ ││││└─┐│  ├─┤├┤  │││ ││  ├┤ ├┬┘
└  └─┘┘└┘└─┘└─┘┴ ┴└─┘─┴┘└─┘┴─┘└─┘┴└─

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