| Crates.io | recurring-tasks |
| lib.rs | recurring-tasks |
| version | 2.1.0 |
| created_at | 2025-02-03 22:43:55.264772+00 |
| updated_at | 2025-10-30 16:49:55.726646+00 |
| description | Define tasks and run them in an app periodically, ala cronjobs. And don't run already/still running tasks. |
| homepage | |
| repository | https://github.com/rogusdev/recurring-tasks |
| max_upload_size | |
| id | 1541184 |
| size | 37,938 |
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.