commit 26aa346ebb11cf2d31030484deede3ed17e84893
parent 1accaa68f06de442a94e000a38df8c0c6a57888d
Author: Jackson G. Kaindume <seestem@protonmail.com>
Date: Thu, 15 Jul 2021 22:58:36 +0200
update documentation
Diffstat:
M | README | | | 53 | ++++++++++++++++++++++++++++++++++++----------------- |
1 file changed, 36 insertions(+), 17 deletions(-)
diff --git a/README b/README
@@ -3,26 +3,45 @@
└ └─┘┘└┘└─┘└─┘┴ ┴└─┘─┴┘└─┘┴─┘└─┘┴└─
----------------------------------------------------------------------
- Simple time based function execution scheduler
+ Simple time based function execution scheduler
----------------------------------------------------------------------
-use funscheduler::{FunScheduler, Timing};
+ use funscheduler::{FunScheduler, Timing};
-fn main() {
- // Execute job every second:
- FunScheduler::interval(job, Timing::Seconds(1));
+ fn main() {
+ // Execute job every second
+ FunScheduler::interval(job, Timing::Seconds(1));
+ }
- // The rest of the API:
- // FunScheduler::interval(job, Timing::Minutes(1));
- // FunScheduler::interval(job, Timing::Hours(1));
- // FunScheduler::interval(job, Timing::Days(1));
+ fn job() {
+ println!("Hello, world");
+ }
- // Execute function once after a specified amount of time:
- // FunScheduler::after(job, Timing::Seconds(1));
-}
+----------------------------------------------------------------------
+ Timings: Easily congigure the timing of the function execution
+----------------------------------------------------------------------
+
+ - Timing::Seconds(1) // Every second
+ - Timing::Minutes(25) // Every 25 minutes
+ - Timing::Hours(2) // Every 2 hours
+ - Timing::Days(1) // Every day same as Timing::Hours(24)
+
+----------------------------------------------------------------------
+ Job runners: Different ways to execute the function
+----------------------------------------------------------------------
-fn job() {
- println!("Hello, world");
-}
+ // 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))
+
+----------------------------------------------------------------------
-----------------------------------------------------------------------
-\ No newline at end of file
+.-{ seestem@protonmail.com ⧉ }-------------------------------------.
+| Written and placed in the public domain by Jackson G. Kaindume |
+'--------------------------------------------------------------[2021]+
+\ No newline at end of file