lool » sched
is a utility library that provides a way to schedule tasks in
various ways. Supports std::thread
and the tokio runtime
(as a feature flag).
This library is for internal use. And as such, it's only published privately.
cargo add lool --registry=lugit --features sched {sub-feature}
At least one of the following features must be enabled to use this library.
The default way to schedule tasks is to use a DateTime
object. However, that means that the task
will only run once. To schedule tasks to run at specific intervals, you can use the following
features:
-
sched.rule-recurrent: Enables the "recurrent-rule" style for scheduling tasks.
-
sched.rule-cron: Enables the "cron-like" style for scheduling tasks
- sched.rule-pyschedule: Enables the python schedule-like style for scheduling tasks
- sched.thread-pool: Enables the
std::thread
runtime support with a thread pool (like scheduled-thread-pool crate but usinglool
's thread pool implementation)
Check the examples directory for usage examples:
This library is inspired by several other libraries, including:
- node-schedule: where the idea of recurring rules was taken from.
- tokio-schedule: tokio async scheduler
- schedule-rs: simple thread-based scheduler
- croner-rust: a croner parser for rust
- job_scheduler: another thread-based job scheduler for rust
- python's schedule: a simple python scheduler with a human-friendly API