public interface Stage<In,Out>
Custom Stage
implementations are intended to be used with
FlowOps.transform(scala.Function0<akka.stream.stage.Stage<Out, T>>)
or
Flow.transform(akka.japi.function.Creator<akka.stream.stage.Stage<Out, U>>)
to extend the Flow
API when there
is no specialized operator that performs the transformation.
Custom implementations are subclasses of PushPullStage
or
DetachedStage
. Sometimes it is convenient to extend
StatefulStage
for support of become like behavior.
It is possible to keep state in the concrete Stage
instance with
ordinary instance variables. The Transformer
is executed by an actor and
therefore you do not have to add any additional thread safety or memory
visibility constructs to access the state from the callback methods.