Skip to main content

Module reducer

Module reducer 

Source
Expand description

Reducer trait implementations.

Reducers are the deterministic fan-in point of the recursive runtime: when a superstep runs several active nodes — including parallel branches or a node that merged results from a subgraph or sub-agent — the executor folds their updates back into one committed state through a reducer, in deterministic active-set order, so merged state is reproducible regardless of completion order. This module supplies the built-in channel/state reducers and the closure-backed escape hatches; see [types] for the trait and marker definitions.

Structs§

AppendReducer
Appends the update vector onto the current vector.
ClosureReducer
A custom binary Reducer backed by a closure.
ClosureStateReducer
A custom StateReducer backed by a closure.
MaxReducer
Keeps the larger of the two values.
MinReducer
Keeps the smaller of the two values.
OverwriteReducer
Overwrites the current value with the update (last-value semantics).
OverwriteStateReducer
A StateReducer that overwrites whole state with the update (the default for State == Update graphs).
SetUnionReducer
Unions the update vector into the current vector, skipping duplicates and preserving first-seen order.

Traits§

Reducer
Merges two values of the same channel type.
StateReducer
Merges a partial Update into the whole graph State.