Skip to main content

every

Function every 

Source
pub async fn every<F, Fut>(
    interval: Duration,
    shutdown: impl Future<Output = ()>,
    job: F,
)
where F: FnMut() -> Fut, Fut: Future<Output = ()>,
Expand description

Runs job at once, then again interval after each run ends, until shutdown completes; a run still going when it does is not awaited.