recurring-tasks

Crates.iorecurring-tasks
lib.rsrecurring-tasks
version2.1.0
created_at2025-02-03 22:43:55.264772+00
updated_at2025-10-30 16:49:55.726646+00
descriptionDefine tasks and run them in an app periodically, ala cronjobs. And don't run already/still running tasks.
homepage
repositoryhttps://github.com/rogusdev/recurring-tasks
max_upload_size
id1541184
size37,938
Chris Rogus (rogusdev)

documentation

README

recurring-tasks -- Recurring Tasks Manager

Rust crate to build an app that (simply) runs recurring, periodic tasks -- effectively cronjobs, in a dedicated process. And will not run a task that is already (still) running. Supports sub-second periods.

Full, but easily digestible, examples are in the apps dir.

This is designed to be a very focused solution for building an app that has only one job: running various tasks repeatedly, forever. Look at (not mine, just shoutout) tokio-cron-scheduler crate for a much more elaborate approach, using crontab syntax.

Very important: in WSL2, Rust's Instant does not properly track seconds for some reason, the virtual clock seems to be just a tiny bit slow relatively to the actual clock, so it will often accumulate 2-3 extra seconds on 20 sec periods... This crate uses Tokio, which is built on Instant, so this drift will be visible in WSL.

Docs.rs documentation.

Commit count: 13

cargo fmt