#cron #job #scheduler #tokio #smol

async-cron-scheduler

Simple lightweight efficient runtime-agnostic async task scheduler with cron expression support

1 stable release

Uses new Rust 2021

1.0.0 Apr 26, 2022

#6 in #smol

Download history 14/week @ 2022-08-09 10/week @ 2022-08-16 8/week @ 2022-08-23 2/week @ 2022-08-30 6/week @ 2022-09-06 4/week @ 2022-09-13 3/week @ 2022-09-20 6/week @ 2022-09-27 4/week @ 2022-10-04 6/week @ 2022-10-18 11/week @ 2022-10-25 21/week @ 2022-11-01 1/week @ 2022-11-08 8/week @ 2022-11-15 41/week @ 2022-11-22

72 downloads per month

MPL-2.0 license

16KB
183 lines

async-cron-scheduler

Simple lightweight efficient runtime-agnostic async task scheduler with cron expression support

Features

  • Simple: The most important feature of all, integrate easily in any codebase.
  • Lightweight: Minimal dependencies with a small amount of code implementing it.
  • Efficient: Tickless design with no reference counters and light structs.
  • Runtime-Agnostic: Bring your own runtime. No runtime dependencies.
  • Async: A single future drives the entire scheduler service.
  • Task Scheduling: Schedule multiple jobs with varying timeframes between them.
  • Cron Expressions: Standardized format for scheduling syntax.

Tips

Scheduled jobs block the executor when they are executing, so it's best to keep their execution short. It's recommended practice to either spawn tasks onto an executor, or send messages from a channel. The good news is that each job being executed has a unique ID associated with it, which you can use for tracking specific tasks.

Demo

Example here

License

Licensed under the Mozilla Public License 2.0.

Contribution

Any contribution intentionally submitted for inclusion in the work by you shall be licensed under the Mozilla Public License 2.0 (MPL-2.0).

Dependencies

~4MB
~68K SLoC