Expand description
§Clokwerk, a simple scheduler
Clokwerk is a simple scheduler, inspired by Python’s Schedule and Ruby’s clockwork. It uses a similar DSL for scheduling, rather than parsing cron strings.
§Usage
§Synchronous
See Scheduler
.
§Asynchronous
See AsyncScheduler
.
§Caveats
Some combinations of times or intervals are permissible, but make little sense, e.g. every(10.seconds()).at("16:00")
, which would next run at the next 4 PM after the next multiple of 10 seconds.
§Similar libraries
- schedule-rs and job_scheduler are two other Rust scheduler libraries. Both use
cron
syntax for scheduling.
Modules§
Structs§
- Async
Job - An asynchronous job to run on the scheduler.
Create these by calling
AsyncScheduler::every()
. - Async
Scheduler - An asynchronous job scheduler, for use with
Future
s. - Schedule
Handle - Guard object for the scheduler background thread. The thread is terminated if this object is dropped, or ScheduleHandle::stop() is called
- Scheduler
- Synchronous job scheduler
- SyncJob
- A job to run on the scheduler.
Create these by calling
Scheduler::every()
.
Enums§
Traits§
- Job
- This trait provides an abstraction over
SyncJob
andAsyncJob
, covering all the methods relating to scheduling, rather than execution. - Next
Time - Time
Units - A trait for easily expressing common intervals. Each method generates an appropriate Interval. Plural and non-plural forms behave identically, but exist to make code more grammatical.