Skip to main content

run_claimed_task_batch

Function run_claimed_task_batch 

Source
pub async fn run_claimed_task_batch<T, SortKey, Error, SortFn, HandlerFn, HandlerFut>(
    claimed_tasks: Vec<T>,
    sort_key: SortFn,
    handler: HandlerFn,
) -> Result<DispatchStats, Error>
where SortKey: Ord, SortFn: FnMut(&T) -> SortKey, HandlerFn: FnMut(T) -> HandlerFut, HandlerFut: Future<Output = Result<TaskDispatchOutcome, Error>>,
Expand description

Runs an already claimed task batch and aggregates task execution outcomes.

The batch is sorted before execution so products can preserve stable created-at/id ordering while still allowing individual task futures to finish out of order.