- Companion:
- class
Value members
Concrete methods
Combine a handler with a predetermined "downstream", creating a BoundHandler
whose push
and finish
methods
delegate to that downstream
receiver instead of needing to accept one as a parameter.
Combine a handler with a predetermined "downstream", creating a BoundHandler
whose push
and finish
methods
delegate to that downstream
receiver instead of needing to accept one as a parameter.
This is useful for implementing more complex handlers, or when interfacing with a Transformer without a Parser, e.g. in order to collect outputs from a transformer into a buffer.
- Type parameters:
- In
The input event type
- Out
The output event type
- Value parameters:
- downstream
The "downstream" handler which will receive outputs from
inner
- inner
The "upstream" handler
- Returns:
A sink for
In
events which uses theinner
handler to receive events, and thedownstream
handler to receive outputs frominner
Combine an existing handler with a variable "downstream" handler, creating a BoundHandler
whose push
and finish
methods
delegate to whatever the current "downstream" is, instead of needing to accept the downstream as a parameter.
Combine an existing handler with a variable "downstream" handler, creating a BoundHandler
whose push
and finish
methods
delegate to whatever the current "downstream" is, instead of needing to accept the downstream as a parameter.
This is similar to bindDownstream
except that you can swap out the actual downstream handler at any time.
This primarily exists as a helper for wiring chains of transformers together; you probably don't want to use this directly.
Wrap an existing transformer handler, protecting it from misuse of the Handler interface methods.
The returned handler guarantees that once the inner handler returns a Stop
signal, throws an exception,
or is told to finish()
, the returned handler will no-op for subsequent calls to finish
or push
.
Wrap an existing transformer handler, protecting it from misuse of the Handler interface methods.
The returned handler guarantees that once the inner handler returns a Stop
signal, throws an exception,
or is told to finish()
, the returned handler will no-op for subsequent calls to finish
or push
.
Furthermore, exceptions thrown by the inner handler will be passed to the inner handler's bubbleUp
method, allowing for possible transformation of errors thrown by the inner handler as if that inner
handler had try/catch wrappers around all of its own logic.
- Type parameters:
- In
The input event type
- Out
The output event type
- Value parameters:
- inner
The handler to wrap
- Returns:
A new handler which wraps the
inner
one, protecting it against interface misuse.