Skip to main content

reduce

Function reduce 

Source
pub fn reduce<F>(
    core: &Core,
    binding: &Arc<dyn OperatorBinding>,
    source: NodeId,
    fold: F,
    seed: HandleId,
) -> OperatorRegistration
where F: Fn(HandleId, HandleId) -> HandleId + Send + Sync + 'static,
Expand description

reduce(source, fold, seed) — left-fold emitting once on upstream COMPLETE.

Accumulates silently while source emits DATA; on source COMPLETE, emits [Dirty, Data(acc), Complete] (where acc is the seed if no DATA arrived). On source ERROR, propagates the error verbatim without emitting the partial accumulator.