Skip to main content

run_periodic_worker_until

Function run_periodic_worker_until 

Source
pub async fn run_periodic_worker_until<E>(
    config: PeriodicWorkerConfig<'_>,
    shutdown: &CancellationToken,
    body: impl AsyncFnMut() -> Result<(), E>,
) -> Result<(), E>
Expand description

run_periodic_worker that returns Ok once shutdown is cancelled. An iteration already running is left to finish; only the wait for the next tick is cut short.