Handler

trait Handler[-In, +Out]

An internally-mutable "handler" that performs a Transformer's input/output logic.

Companion:
object
class Object
trait Matchable
class Any
trait Stateless[In, Out]
class TransformerCollect[In, Out]
class TransformerMap[A, B]
class TransformerMapFlatten[In, Out]
class TransformerTap[In]
class HandlerProtect[In, Out]
class Handler[In, Out]
class Handler[In, A, Out]
class BoundariesHandler[In, C]
class Handler[In, Elem, C]
class BounariesHandler[In, C]
class Handler[In, C, Out]
class Handler[In]
class Handler[In]

Value members

Abstract methods

def finish(out: HandlerWrite[Out]): Unit

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

def push(in: In, out: HandlerWrite[Out]): Signal

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.

def bubbleUp(err: Throwable): Nothing

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

def pushMany(ins: Iterator[In], out: HandlerWrite[Out]): Signal

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