Represents a current result
, and a count of previous results that were Errors.
StateAccumulator that uses the latest event as its state, ignoring any previous 'state' value.
Intermediate result for subdivide
and subdivideOnState
.
State accumulator that keeps track of the open elements and their attributes.
An Enumeratee that accumulates an error count for results passed through it.
An Enumeratee that accumulates an error count for results passed through it.
The numErrorsEmitted
counter will increment **after** a state with an error
result. In this manner, the first error passed through will be accompanied by
numErrorsEmitted = 0
, but the very next event will have numErrorsEmitted = 1
.
This behavior can be used in combination with a TakeWhile
enumeratee to limit
the number of errors accepted by the downstream consumers, or kill the stream
at (or just after) an error.
The type of the results being passed through
Creates an enumeratee that prepends the given value
Creates an enumeratee that prepends the given value
The value to prepend
Create a new Enumeratee that advances a "state" based on the values of the incoming results.
Create a new Enumeratee that advances a "state" based on the values of the incoming results. Empty inputs will be ignored. Error results will be passed through, but will cause the state to be reset to the folder's initial state.
The type of Result
accepted by the returned Enumeratee
The type of Result
generated by the returned Enumeratee
A StreamScan
that folds values of type A
into a State,
producing results of type B
.
Create a new Enumeratee that advances a "state" based on incoming results.
Create a new Enumeratee that advances a "state" based on incoming results.
Errors and Empty results will be ignored, while Success results will have
their values passed through the given StreamScan
to produce new results.
When the stream reaches an EOF, any remaining state will be 'finished' to
potentially create one final result.
The type of values that go into the StreamScan
The type of results that come out of the StreamScan
A StreamScan
that folds values of type A
into a State,
producing results of type B
.
Simplified case of subdivide
, where the "state" is ignored, and the "context" is
defined by whichever events match the given filter
.
Simplified case of subdivide
, where the "state" is ignored, and the "context" is
defined by whichever events match the given filter
. When using combineWith
, the
context will be whichever event happens to be first in that substream.
Creates an Enumeratee that divides the incoming stream into substreams of consecutive events that match some context.
Creates an Enumeratee that divides the incoming stream into substreams of consecutive events that match some context. Events are folded through a state accumulator in order to determine a "state" for each event. Then each state is passed through a context matching function to determine an optional context value for the event. The context matched by the first event in each substream can then be used to create an Iteratee that consumes that substream. The resulting Enumeratee feeds the result of each substream's consumer (Iteratee).
The event type
The state type
The context type
StateAccumulator used to determine some "state" value for each event
Context-matching function that will be called on each event's "state".
implicit ExecutionContext used to combine inner Iteratees and Enumeratees
A Subdivided
instance that can be combined with an Iteratee, creating an Enumeratee
that produces the results of running that Iteratee on each substream
subdivide
variant for XMLEvents that uses an accumulated TagStack
as the input
to the context matcher.
subdivide
variant for XMLEvents that uses an accumulated TagStack
as the input
to the context matcher.
Shortcut for takeThroughNthError(1)
.
Shortcut for takeThroughNthError(1)
.
An Enumeratee that feeds through Result
s of type A
until just
after the 1st Error
result.
The type of Results being passed through
An Enumeratee that feeds through Result
s of type A
until just
after the n
th Error
result.
An Enumeratee that feeds through Result
s of type A
until just
after the n
th Error
result. In other words, streams transformed
by this Enumeratee will contain **at most** n
Errors, and will end
after the n
th error.
The type of Results being passed through
The number of errors to be passed through before ending the stream
Shortcut for takeUntilNthError(1)
.
Shortcut for takeUntilNthError(1)
.
An Enumeratee that feeds through Result
s of type A
, treating the
first Error
result as an EOF.
Type type of Results being passed through
An Enumeratee that feeds through Result
s of type A
until just
before the n
th Error
result.
An Enumeratee that feeds through Result
s of type A
until just
before the n
th Error
result. In other words, streams transformed
by this Enumeratee will contain **less than** n
Errors, and will end
before passing through the n
th error.
The type of Results being passed through
The error count threshold before the stream is stopped
Creates an enumeratee that pairs its inputs with an accumulated state.
Creates an enumeratee that pairs its inputs with an accumulated state.
An accumulator object whose init
value will be used as the
first state, and whose update
function will be used to step
from one state to the next given an input.
Create an enumeratee that pairs its inputs with an accumulated state.
Create an enumeratee that pairs its inputs with an accumulated state.
The initial state value
A function that takes a state and an input, returning a new state
Created by dylan on 10/10/2015.