Skip to main content

initial_due

Function initial_due 

Source
pub fn initial_due(trigger: &Trigger, now_ms: i64) -> Result<Option<i64>>
Expand description

When a never-evaluated trigger first becomes due.

None means “now”. Some(t) means “not yet — at t”, and the evaluator records it so the trigger wakes at the right moment instead of being asked this question again on every pass.

The split is between two kinds of cadence:

  • Relative (Interval, Polling) has no baseline to wait out, so it fires at once — the loop gate’s rule, and what makes a polling trigger seed its cursor promptly instead of an interval later.
  • Absolute (Schedule, Once) waits for the instant it names. A cron of 0 9 * * * must not fire at midnight merely because it was just declared.
  • Unclocked kinds are eligible immediately; what gates them is whether anything arrived, which the evaluator decides.