#task #duration #time #sync #scheduling #interval #note

periodic

Simple scheduling tool for running tasks at fixed intervals

2 releases

Uses old Rust 2015

0.1.1 Oct 13, 2018
0.1.0 Jul 15, 2018

#46 in #note

Download history 30/week @ 2024-07-21 22/week @ 2024-07-28 13/week @ 2024-08-04 40/week @ 2024-08-11 23/week @ 2024-08-18 28/week @ 2024-08-25 8/week @ 2024-09-01 16/week @ 2024-09-08 16/week @ 2024-09-15 58/week @ 2024-09-22 47/week @ 2024-09-29 5/week @ 2024-10-06 30/week @ 2024-10-13 29/week @ 2024-10-20 36/week @ 2024-10-27 66/week @ 2024-11-03

162 downloads per month
Used in kipa

GPL-3.0 license

17KB
238 lines

periodic

Crates.io Documentation

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.

No runtime deps