Skip to main content

set_timer

Function set_timer 

Source
pub fn set_timer(
    delay: Duration,
    task: impl Future<Output = ()> + 'static,
) -> TimerHandle
Expand description

Arm one asynchronous one-shot callback.

Higher-level policies should use one-shots even for recurring work so they can control exactly when a successor becomes authoritative.