View Source Skitter.BIO.KeyedReduce (Skitter v0.7.1)
Keyed Reduce operation.
This operation implements a reduce operation. It accepts three arguments wrapped in a tuple when
embedded inside a workflow: a key function, a reduce function and an initial state. When this
operation receives data, the key function is called with the received data as its first
argument. The key function should return a key, which is used to obtain the state associated
with the key. Afterwards, the reduce function is called with the received data as its first
argument and the state associated with the key returned by the key function as its second
argument. This function should return a {state, emit}
tuple. The first value of this tuple
will be stored as the new state of the key, while the second value of this tuple will be emitted
on the _
out port.
Operation Properties
- in ports:
_
- out ports:
_
- default strategy:
Skitter.BIS.KeyedState