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§
- Dispatch
Plan - Which workers may run concurrently, in input order.
- Item
Outcome - The outcome of one item in a parallel map/reduce, tagged with its input index so callers can correlate results back to inputs.
- Parallel
Options - Options controlling parallel execution.
- Parallel
Outcome - The collected result of a parallel map/reduce, preserving input order.
- Workspace
Claim - One worker’s declared relationship to a fan-out’s shared workspace.
Enums§
- Claim
Conflict - Why a worker cannot be scheduled against the shared workspace.
- Claim
Path Error - Why a claim string could not be parsed into safe relative paths.
- Dispatch
Mode - How a worker must be dispatched relative to its siblings.
- Failure
Policy - What
map_reducedoes when some items fail.
Functions§
- map_
reduce - Runs
foveritemsconcurrently (bounded byParallelOptions::max_concurrency), collecting per-item outcomes in input order and applying the configuredFailurePolicy. - parse_
relative_ claim_ paths - Parses a claim list into safe, sorted, deduplicated relative paths.
- paths_
overlap truewhen two claimed paths cannot be held by different workers at once.- plan_
shared_ workspace_ dispatch - Decides which workers may run concurrently against one shared workspace.
- writes_
shared_ workspace truewhen a tool’s declared effects can mutate a shared workspace.