pub async fn map_reduce<I, T, F, Fut>(
items: Vec<I>,
options: ParallelOptions,
f: F,
) -> Result<ParallelOutcome<T>>Expand description
Runs f over items concurrently (bounded by
ParallelOptions::max_concurrency), collecting per-item outcomes in input
order and applying the configured FailurePolicy.
f receives each item’s input index and the item, and returns a future
yielding Result<T>. The mapping is deterministic in input order regardless
of completion order.
§Errors
FailurePolicy::FailFastreturns the first item error (in input order), cancelling remaining in-flight work.FailurePolicy::QuorumreturnsTinyAgentsError::Graphwhen fewer than the required number of items succeeded.FailurePolicy::CollectAllandFailurePolicy::BestEffortnever error.