An open API service indexing awesome lists of open source software.

https://github.com/syaiful6/croni

Cron data structure, parser and schedule explorer for OCaml
https://github.com/syaiful6/croni

Last synced: 4 days ago
JSON representation

Cron data structure, parser and schedule explorer for OCaml

Awesome Lists containing this project

README

          

# Croni

Cron data structure, Angstrom parser and schedule explorer for OCaml.

```ocaml
(** create a cron schedule and test again current timestamp *)
let schedule = Option.get_ok @@ Croni.Parser.parse_cron_schedule "*/2 * * * *"
let now = Ptime_clock.now ()
if Croni.Schedule.matches schedule now
then
print_endline "schedule matches"
(** run your functions/tasks here *)
else
(** your cron schedule not matches against current time! DO Nothing *)
print_endline "schedule not matches"
```