Crates.io | jact |
lib.rs | jact |
version | 0.4.2 |
source | src |
created_at | 2021-12-14 19:48:29.109185 |
updated_at | 2023-10-14 20:46:17.309236 |
description | Schedule tasks on tokio using cron-like annotation. Also schedule tasks at an instant or repeat them at a fixed duration. |
homepage | |
repository | https://github.com/erichCompSci/jact |
max_upload_size | |
id | 497888 |
size | 59,767 |
Use cron-like scheduling in an async tokio environment. Also schedule tasks at an instant or repeat them at a fixed duration.
Inspired by https://github.com/mvniekerk/tokio-chron-scheduler
Creating a schedule for a job is done using the FromStr
impl for the
Schedule
type of the cron library.
The scheduling format is as follows:
sec min hour day of month month day of week year
* * * * * * *
Time is specified for UTC
and not your local timezone. Note that the year may
be omitted.
Comma separated values such as 5,8,10
represent more than one time value. So
for example, a schedule of 0 2,14,26 * * * *
would execute on the 2nd, 14th,
and 26th minute of every hour.
Ranges can be specified with a dash. A schedule of 0 0 * 5-10 * *
would
execute once per hour but only on day 5 through 10 of the month.
Day of the week can be specified as an abbreviation or the full name. A
schedule of 0 0 6 * * Sun,Sat
would execute at 6am on Sunday and Saturday.
A simple example is provided in the examples directory.
## License
jact is licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or
http://opensource.org/licenses/MIT)
## Contributing
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
Please see the [CONTRIBUTING](CONTRIBUTING.md) file for more information.