2 releases
Uses old Rust 2015
0.1.1 | Oct 13, 2018 |
---|---|
0.1.0 | Jul 15, 2018 |
#46 in #note
162 downloads per month
Used in kipa
17KB
238 lines
periodic
Simple scheduling tool for running tasks at fixed intervals.
lib.rs
:
Simple scheduling tool for running tasks at fixed intervals.
Handles all threads for scheduling and running tasks. Note that callbacks
passed in must be able to execute asynchronously, and therefore require
traits Fn
(not FnMut
), Sync
, and Send
. They must also have a
'static
lifetime.
Example usage
use std::time::Duration;
let mut planner = periodic::Planner::new();
planner.add(
|| println!("every three seconds"),
periodic::Every::new(Duration::from_secs(3)),
);
planner.start();
See ./examples
for more detailed usage.