interface AsyncReducer.Impl<I,O,S>
The AsyncReducer implementation interface defining the required methods.
Implemented by: Base<I,O,S>
Type parameters
Name | Description |
---|---|
I | the input type |
O | the output type |
S | the state type |
Properties
init
The initial state value for the reducer algorithm.
init
mapInput
Returns an AsyncReducer
instance that converts its input values using given mapFun
before passing them to the reducer.
mapInput
AsyncReducer
instance that converts its input values using given mapFun
before passing them to the reducer.onClose
An optional function that is called when the reducer will no longer receive values.
onClose
Methods
chain
Returns a reducer that applies the given nextReducers
sequentially after this reducer has halted, and moving on to the next provided reducer until it is halted. Optionally, it provides the last output value of the previous reducer.
chain
nextReducers
sequentially after this reducer has halted, and moving on to the next provided reducer until it is halted. Optionally, it provides the last output value of the previous reducer.collectInput
Returns an AsyncReducer
instance that converts or filters its input values using given collectFun
before passing them to the reducer.
collectInput
AsyncReducer
instance that converts or filters its input values using given collectFun
before passing them to the reducer.compile
Returns a promise that resolves to a 'runnable' instance of the current reducer specification. This instance maintains its own state and indices, so that the instance only needs to be provided the input values, and output values can be retrieved when needed. The state is kept private.
compile
dropInput
Returns an AsyncReducer
instance that skips the first given amount
of input elements, and will process subsequent elements.
dropInput
AsyncReducer
instance that skips the first given amount
of input elements, and will process subsequent elements.filterInput
Returns an AsyncReducer
instance that only passes values to the reducer that satisy the given pred
predicate.
filterInput
AsyncReducer
instance that only passes values to the reducer that satisy the given pred
predicate.flatMapInput
Returns an AsyncReducer
instance that converts its input values using given flatMapFun
before passing them to the reducer.
flatMapInput
AsyncReducer
instance that converts its input values using given flatMapFun
before passing them to the reducer.mapOutput
Returns an AsyncReducer
instance that converts its output values using given mapFun
.
mapOutput
AsyncReducer
instance that converts its output values using given mapFun
.next
Returns the next state based on the given input values
next
sliceInput
Returns an AsyncReducer
instance that takes given amount
of elements starting at given from
index, and ignores other elements.
sliceInput
AsyncReducer
instance that takes given amount
of elements starting at given from
index, and ignores other elements.stateToResult
Returns the output value based on the given state
stateToResult
state
takeInput
Returns an AsyncReducer
instance that takes at most the given amount
of input elements, and will ignore subsequent elements.
takeInput
AsyncReducer
instance that takes at most the given amount
of input elements, and will ignore subsequent elements.takeOutput
Returns an 'AsyncReducerinstance that produces at most
amount` values.
takeOutput
instance that produces at most
amount` values.takeOutputUntil
Returns an 'AsyncReducerinstance that produces until the given
pred` predicate returns true for the output value.
takeOutputUntil
instance that produces until the given
pred` predicate returns true for the output value.