clokwerk/lib.rs
1//! # Clokwerk, a simple scheduler
2//!
3//! Clokwerk is a simple scheduler, inspired by Python's [Schedule](https://schedule.readthedocs.io/en/stable/)
4//! and Ruby's [clockwork](https://github.com/Rykian/clockwork). It uses a similar DSL for scheduling, rather than
5//! parsing cron strings.
6//!
7//! ## Usage
8//! ### Synchronous
9//! See [`Scheduler`].
10//! ### Asynchronous
11//! See [`AsyncScheduler`].
12//! ## Caveats
13//! 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.
14//!
15//! ## Similar libraries
16//! * [schedule-rs](https://github.com/mehcode/schedule-rs) and [job_scheduler](https://github.com/lholden/job_scheduler) are two other Rust scheduler libraries. Both use `cron` syntax for scheduling.
17#[cfg(feature = "async")]
18mod async_job;
19#[cfg(feature = "async")]
20mod async_scheduler;
21mod intervals;
22mod job;
23mod job_schedule;
24mod scheduler;
25mod sync_job;
26pub mod timeprovider;
27
28pub use crate::intervals::{Interval, NextTime, TimeUnits};
29pub use crate::job::Job;
30pub use crate::scheduler::{ScheduleHandle, Scheduler};
31pub use crate::sync_job::SyncJob;
32
33#[cfg(feature = "async")]
34pub use crate::async_job::AsyncJob;
35#[cfg(feature = "async")]
36pub use crate::async_scheduler::AsyncScheduler;