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.
(contextMiddleman: StringAdd).self
(contextMiddleman: StringFormat).self
(contextMiddleman: ArrowAssoc[ContextMiddleman[Context, In, P]]).x
(Since version 2.10.0) Use leftOfArrow
instead
(contextMiddleman: Ensuring[ContextMiddleman[Context, In, P]]).x
(Since version 2.10.0) Use resultOfEnsuring
instead
Part of the
Splitter
implementation responsible for creating anIn => P => Out
chain for a downstream handler. Implementations will create handlers that consume an stream of events by forwarding some transformation of those events to the downstream handler. E.g. by consuming the stream to a P and sending theP
values downstream, or by transforming the stream to a series ofP
values and sending thoseP
values downstream.