Create a wrapper for the downstream handler based on a context.
Create a wrapper for the downstream handler based on a context. The wrapper's job is to intercept events (even EOF), interpreting them in some way, and forwarding results to the downstream handler.
The wrapper handler should only return Some
from *any* of its handleX
methods if the *downstream*
handler returned a Some
. It is allowed to become finished without returning Some
, e.g. if the
wrapper serves as a Take(n) transformer, or some other transformer that ends early.
But the idea is that the middleman wrapper is disposable, with a new one created for each new context. Whatever handler is managing creation of contexts (and therefore calling this method) is responsible for sending a final EOF signal to the downstream handler.
(contextTransformerMiddleman: StringAdd).self
(contextTransformerMiddleman: StringFormat).self
(contextTransformerMiddleman: ArrowAssoc[ContextTransformerMiddleman[Context, In, P]]).x
(Since version 2.10.0) Use leftOfArrow
instead
(contextTransformerMiddleman: Ensuring[ContextTransformerMiddleman[Context, In, P]]).x
(Since version 2.10.0) Use resultOfEnsuring
instead
HandlerMiddleman that acts as a transformer, but guards against the EOF signal being sent via the transformer.