Skip to main content

run_with_concurrency_limit

Function run_with_concurrency_limit 

Source
pub async fn run_with_concurrency_limit<T, O, F, Fut>(
    items: Vec<T>,
    limit: usize,
    handler: F,
) -> Vec<O>
where F: FnMut(T) -> Fut, Fut: Future<Output = O>,
Expand description

Runs item handlers with a bounded number of in-flight futures.

Claimed task batches are already capacity-checked by lane claiming. This helper only preserves the product’s requested upper bound while letting independent task futures finish out of order.