Skip to main content

drain_dispatcher

Function drain_dispatcher 

Source
pub async fn drain_dispatcher<DispatchFn, DispatchFut, CountFn, CountFut, Error>(
    max_rounds: usize,
    processing_poll_interval: Duration,
    dispatch_due: DispatchFn,
    count_processing: CountFn,
) -> Result<DispatchStats, Error>
where DispatchFn: FnMut() -> DispatchFut, DispatchFut: Future<Output = Result<DispatchStats, Error>>, CountFn: FnMut() -> CountFut, CountFut: Future<Output = Result<u64, Error>>,
Expand description

Drains a dispatcher until it has no claimed work and no active processing tasks.

Product crates provide the real dispatch function and processing-count query. The helper keeps the shared bounded retry loop and aggregate statistics in Forge while leaving storage and status semantics outside this crate.