pub enum TimerOverrunPolicy {
Skip,
CatchUp,
}Expand description
What a periodic timer does with periods it missed while its executor was blocked (issue #505).
A tier that loses the CPU for several periods — a long-running callback, or preemption by a higher-priority band — resumes with accumulated elapsed time worth more than one period.
Variants§
Skip
Coalesce the backlog: fire ONCE and drop the missed periods,
counting them in overruns. Phase is preserved (the sub-period
remainder carries over), so activations stay aligned to the
original cadence grid instead of drifting by each stall.
The default, matching rclcpp (which advances the next call time
past “now”) and Zephyr’s k_timer (which coalesces expiries and
reports a count).
CatchUp
Replay every missed period, one activation per try_process
pass, until the backlog drains. Correct for timers that count or
accumulate, where each activation is a unit of work that must
not be lost. A replay burst runs back-to-back at dispatch speed,
NOT at the declared cadence — control loops usually want Skip.
Trait Implementations§
Source§impl Clone for TimerOverrunPolicy
impl Clone for TimerOverrunPolicy
Source§fn clone(&self) -> TimerOverrunPolicy
fn clone(&self) -> TimerOverrunPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TimerOverrunPolicy
Source§impl Debug for TimerOverrunPolicy
impl Debug for TimerOverrunPolicy
Source§impl Default for TimerOverrunPolicy
impl Default for TimerOverrunPolicy
Source§fn default() -> TimerOverrunPolicy
fn default() -> TimerOverrunPolicy
impl Eq for TimerOverrunPolicy
Source§impl PartialEq for TimerOverrunPolicy
impl PartialEq for TimerOverrunPolicy
Source§fn eq(&self, other: &TimerOverrunPolicy) -> bool
fn eq(&self, other: &TimerOverrunPolicy) -> bool
self and other values to be equal, and is used by ==.