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§
- Cron
JobHandle - Handle to a scheduled cron job. Dropping or calling
CronJobHandle::cancelcancels it. - Cron
JobInfo - Snapshot info for a cron job.
- Cron
JobOptions - Options for
schedule_cron. - Cron
Manager - Owns scheduled jobs, the schedule driver, and the cron event broadcast.
- Cron
Session Options - Durable session options accepted by a cron action. The action owns the agent name and generates a unique session ID for each run.
Enums§
- Cron
Action - A cron action.
Callbackholds an in-process closure and cannot cross the wire. - Cron
Action Info - Serializable description of a scheduled action. Callback jobs deliberately expose only their kind: the host closure is execution state, not job data.
- Cron
Event - A cron event emitted on each run.
- Cron
Overlap - Overlap policy for a cron job.