funscheduler

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit a4f60bd5bde21448e77fb53d46d90f4c00fd8cc5
parent 2eb7c8255bc08dc8291acf27b461e14cb049bd23
Author: Jackson G. Kaindume <seestem@protonmail.com>
Date:   Sun, 18 Jul 2021 11:05:45 +0200

use md for README

Diffstat:
AREADME.md | 49+++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -0,0 +1,49 @@ +``` text + ┌─┐┬ ┬┌┐┌┌─┐┌─┐┬ ┬┌─┐┌┬┐┬ ┬┬ ┌─┐┬─┐ + ├┤ │ ││││└─┐│ ├─┤├┤ │││ ││ ├┤ ├┬┘ + └ └─┘┘└┘└─┘└─┘┴ ┴└─┘─┴┘└─┘┴─┘└─┘┴└─ +``` + +Time based function execution scheduler + +``` rust +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 + +``` rust +Timing::Seconds(1) +Timing::Minutes(25) +Timing::Hours(2) +Timing::Days(1) +``` + +## Job runners, different methods to execute the function + +``` rust +// 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)) +``` + +``` text +.-{ seestem@protonmail.com ⧉ }-------------------------------------. +| Written by Jackson G. Kaindume | +'--------------------------------------------------------------[2021]+ +```