Skip to main content

Module parallel

Module parallel 

Source
Expand description

Ordered, bounded-concurrency parallel map/reduce with a configurable failure policy.

Graph Send fanout is the low-level primitive for parallel supersteps, but callers frequently want a reusable “run these N items concurrently and reduce the results” helper with deterministic input-order results, a concurrency cap, per-item success/failure isolation, and a policy for what to do when some items fail (fail-fast, collect-all, quorum, best-effort). That is what map_reduce provides, independent of the graph executor.

Results are always returned in input order even though items complete out of order: concurrency is driven by buffer_unordered, which yields items as they finish, and each future carries its input index so the completed results are re-sorted into input-order slots before being returned.

Structs§

ItemOutcome
The outcome of one item in a parallel map/reduce, tagged with its input index so callers can correlate results back to inputs.
ParallelOptions
Options controlling parallel execution.
ParallelOutcome
The collected result of a parallel map/reduce, preserving input order.

Enums§

FailurePolicy
What map_reduce does when some items fail.

Functions§

map_reduce
Runs f over items concurrently (bounded by ParallelOptions::max_concurrency), collecting per-item outcomes in input order and applying the configured FailurePolicy.