Skip to main content

Module cron

Module cron 

Source
Expand description

Cron scheduling + the CronManager.

Ported from packages/core/src/cron/. The schedule is a 5/6/7-field cron expression (croner grammar) or an ISO-8601 one-shot timestamp. CronAction::Callback is in-process only (non-serializable). on_cron_event returns NO unsubscribe in TS; the Rust equivalent is a tokio::sync::broadcast::Receiver whose drop is the unsubscribe.

Timing is owned by the ScheduleDriver (mirroring TS CronManager.schedule delegating to this.driver.schedule({...})). The default crate::config::TimerScheduleDriver parses the schedule, arms the timer, reschedules cron after each fire, and tears down on dispose. The manager itself only registers job state and runs execute_job when the driver fires the callback.

Cron fields are interpreted in the host LOCAL timezone, matching croner’s default behavior.

Structs§

CronJobHandle
Handle to a scheduled cron job. Dropping or calling CronJobHandle::cancel cancels it.
CronJobInfo
Snapshot info for a cron job.
CronJobOptions
Options for schedule_cron.
CronManager
Owns scheduled jobs, the schedule driver, and the cron event broadcast.

Enums§

CronAction
A cron action. Callback holds an in-process closure and cannot cross the wire.
CronEvent
A cron event emitted on each run.
CronOverlap
Overlap policy for a cron job.