An internally-mutable "handler" that performs a Transformer's input/output logic.
- Companion:
- object
Value members
Abstract methods
In response to the end of the stream of incoming values, this handler may output any number of
final output values via the provided HandlerWrite
.
The expectation is that a Handler's finish
method will only ever be called once before that
Handler is discarded, with the exception of Stateless
Transformers, which act as their own
Handlers and will be reused.
In response to the end of the stream of incoming values, this handler may output any number of
final output values via the provided HandlerWrite
.
The expectation is that a Handler's finish
method will only ever be called once before that
Handler is discarded, with the exception of Stateless
Transformers, which act as their own
Handlers and will be reused.
- Value parameters:
- out
The downstream receiver of output values
In response to some input value in
, this handler may output any number of output values
via the provided HandlerWrite
, possibly change its internal state, and signal to the
upstream caller whether it wants to continue or stop receiving new inputs.
Upstream handlers SHOULD avoid making more calls to this handler's push
after it returns Signal.Stop
.
In response to some input value in
, this handler may output any number of output values
via the provided HandlerWrite
, possibly change its internal state, and signal to the
upstream caller whether it wants to continue or stop receiving new inputs.
Upstream handlers SHOULD avoid making more calls to this handler's push
after it returns Signal.Stop
.
- Value parameters:
- in
An input value
- out
The downstream receiver of output values
- Returns:
A "signal" indicating whether this handler wants to continue receiving inputs afterward
Concrete methods
Wraps this handler as a "top level" handler, which will inject a SpacTraceElement
(representing the current input or the "EOF" signal)
to any exception is thrown by this handler when calling its step
or finish
methods.
Wraps this handler as a "top level" handler, which will inject a SpacTraceElement
(representing the current input or the "EOF" signal)
to any exception is thrown by this handler when calling its step
or finish
methods.
Used internally by Transformers transform
and toPipe
methods.
In response to an error thrown and caught from a downstream consumer, this handler may modify the exception on its way back upstream. Used by the "spac frame" transformer.
In response to an error thrown and caught from a downstream consumer, this handler may modify the exception on its way back upstream. Used by the "spac frame" transformer.
- Value parameters:
- err
An error thrown by some downstream handler
- Returns:
Nothing, because this method must always throw something
Convenience for calling push
multiple times, aborting early
if the signal becomes Stop
in response to any one push.
Convenience for calling push
multiple times, aborting early
if the signal becomes Stop
in response to any one push.
- Value parameters:
- ins
An iterator which produces input values to push into this handler
- out
The downstream receiver of output values
- Returns:
A "signal" indicating whether this handler wants to continue receiving inputs afterward