Skip to main content

prebreak_warn_due

Function prebreak_warn_due 

Source
pub fn prebreak_warn_due(
    gate: PrebreakGate,
    last_fire: Instant,
    interval_secs: u64,
    lead_secs: u64,
    now: Instant,
) -> bool
Expand description

True iff the pre-break notification for this kind should fire now — i.e. we’re inside the lead window before a due interval break, and we haven’t already shown the notification for this cycle.

Pure analogue of the inline check in run_loop. Decoupled from Scheduler state so tests can drive it with synthetic instants. The four short-circuit conditions are grouped into PrebreakGate so call sites set each by name instead of passing a run of positional booleans.