Bogdan Popa <bogdan@defn.io>
This package provides functionality for scheduling work inside of Racket using cron-like syntax.
syntax
[schedule-exprhandler-expr]...+)schedule-expr : string?
Handlers are executed synchronously within each thread, meaning procedures that take a long time to execute may cause runs to be skipped.
1755477161
1755477162
1755477163
1755477164
1755477165
1755477166
> (stop)
The spawned threads log information about what is currently being run to the “crontab” topic.
Changed in version 0.2 of package crontab-lib: Extended logging.
Schedules constrain the components of a timestamp to match specific moments in time.
Schedules can be used as synchronizable events. A schedule is ready for synchronization when the value of (current-seconds ) is less than or equal to the value of (schedule-next s) as of the moment the event is synchronized on. The synchronization result of a schedule is the schedule itself and the timestamp (in seconds) it became ready for synchronization at.
>>> (~datenow)"2022-08-19T10:21:30"
"2022-08-19T10:21:30"
"2022-08-19T10:22:00"
"2022-08-19T15:00:00"
"2022-08-19T12:00:00"
"2024-02-29T00:00:00"
>2022年08月19日T11:00:00
2022年08月19日T12:00:00
2022年08月19日T13:00:00
2022年08月19日T14:00:00
2022年08月19日T15:00:00
2022年08月19日T16:00:00
2022年08月19日T17:00:00
2022年08月19日T18:00:00
2022年08月19日T19:00:00
2022年08月19日T20:00:00
1660939201
>#<schedule>
1755477166
procedure
( parse-schedule s[local-time?])→schedule?
s:string?
“@” commands are not supported,
“0” is not a valid weekday, and
month and weekday names are not supported.
When a schedule contains 6 fields instead of 5, the first field is treated as a constraint on the seconds component of a timestamp.
Timestamps are processed by the schedule according to the local time zone if local-time? is #t and UTC otherwise.
procedure
( schedule-matches? stimestamp)→boolean?
timestamp:exact-integer?
procedure
( schedule-next s[start-timestamp])→exact-integer?
procedure
( schedule->string s)→string?