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
- Host: GitHub
- URL: https://github.com/syaiful6/croni
- Owner: syaiful6
- License: mit
- Created: 2024-09-07T08:39:48.000Z (almost 2 years ago)
- Default Branch: develop
- Last Pushed: 2026-01-30T03:49:47.000Z (6 months ago)
- Last Synced: 2026-07-20T19:38:08.288Z (4 days ago)
- Language: OCaml
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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"
```