Module backoff

Module backoff 

Source
Expand description

Exponential-backoff probe scheduler.

Starts at DiscoveryConfig::hello_interval_base and doubles on each tick where no probe is needed, up to DiscoveryConfig::hello_interval_max. Jitter of ±DiscoveryConfig::hello_jitter × interval is applied to each computed deadline to desynchronise nodes that started simultaneously.

§Reset behaviour

Any TriggerEvent resets the interval to the base and sets pending_immediate = true so that the very next [on_tick] call emits a ProbeRequest::Broadcast without waiting for the deadline. A successful probe ([on_probe_success]) similarly resets the interval; a probe timeout ([on_probe_timeout]) advances to the next (doubled) level.

Structs§

BackoffScheduler
Probe scheduler that uses exponential back-off with jitter.