Packages

p

akka.stream

stage

package stage

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. abstract class AbstractInHandler extends InHandler

    Java API: callbacks for an input port where termination logic is predefined (completing when upstream completes, failing when upstream fails).

  2. abstract class AbstractInOutHandler extends InHandler with OutHandler

    Java API: callback combination for output and input ports where termination logic is predefined (completing when upstream completes, failing when upstream fails, completing when downstream cancels).

  3. abstract class AbstractOutHandler extends OutHandler

    Java API: callbacks for an output port where termination logic is predefined (completing when downstream cancels).

  4. trait AsyncCallback [T] extends AnyRef

    An asynchronous callback holder that is attached to a GraphStageLogic.

    An asynchronous callback holder that is attached to a GraphStageLogic. Invoking AsyncCallback#invoke will eventually lead to the registered handler being called.

  5. sealed trait AsyncDirective extends Directive
  6. sealed trait Context [Out] extends LifecycleContext

    Passed to the callback methods of PushPullStage and StatefulStage.

  7. trait DetachedContext [Out] extends Context[Out]

    Passed to the callback methods of DetachedStage.

    Passed to the callback methods of DetachedStage.

    #hold stops execution and at the same time putting the stage in a holding state. If the stage is in a holding state it contains one absorbed signal, therefore in this state the only possible command to call is #pushAndPull which results in two events making the balance right again: 1 hold + 1 external event = 2 external event

  8. sealed trait Directive extends AnyRef

    Return type from Context methods.

  9. sealed trait DownstreamDirective extends SyncDirective
  10. sealed abstract class FreeDirective extends UpstreamDirective with DownstreamDirective with TerminationDirective with AsyncDirective
  11. abstract class GraphStage [S <: Shape] extends GraphStageWithMaterializedValue[S, NotUsed]

    A GraphStage represents a reusable graph stream processing stage.

    A GraphStage represents a reusable graph stream processing stage. A GraphStage consists of a Shape which describes its input and output ports and a factory function that creates a GraphStageLogic which implements the processing logic that ties the ports together.

  12. abstract class GraphStageLogic extends AnyRef

    Represents the processing logic behind a GraphStage.

    Represents the processing logic behind a GraphStage. Roughly speaking, a subclass of GraphStageLogic is a collection of the following parts: * A set of InHandler and OutHandler instances and their assignments to the Inlets and Outlets of the enclosing GraphStage * Possible mutable state, accessible from the InHandler and OutHandler callbacks, but not from anywhere else (as such access would not be thread-safe) * The lifecycle hooks preStart() and postStop() * Methods for performing stream processing actions, like pulling or pushing elements

    The stage logic is completed once all its input and output ports have been closed. This can be changed by setting setKeepGoing to true.

    The postStop lifecycle hook on the logic itself is called once all ports are closed. This is the only tear down callback that is guaranteed to happen, if the actor system or the materializer is terminated the handlers may never see any callbacks to onUpstreamFailure, onUpstreamFinish or onDownstreamFinish. Therefore stage resource cleanup should always be done in postStop.

  13. abstract class GraphStageLogicWithLogging extends GraphStageLogic with StageLogging

    Java API: GraphStageLogic with StageLogging.

  14. abstract class GraphStageWithMaterializedValue [+S <: Shape, +M] extends Graph[S, M]
  15. trait InHandler extends AnyRef

    Collection of callbacks for an input port of a GraphStage

  16. trait LifecycleContext extends AnyRef
  17. trait OutHandler extends AnyRef

    Collection of callbacks for an output port of a GraphStage

  18. trait StageLogging extends AnyRef

    Simple way to obtain a LoggingAdapter when used together with an ActorMaterializer.

    Simple way to obtain a LoggingAdapter when used together with an ActorMaterializer. If used with a different materializer NoLogging will be returned.

    Make sure to only access log from GraphStage callbacks (such as pull, push or the async-callback).

    Note, abiding to akka.stream.ActorAttributes.logLevels has to be done manually, the logger itself is configured based on the logSource provided to it. Also, the log itself would not know if you're calling it from a "on element" context or not, which is why these decisions have to be handled by the stage itself.

  19. abstract class StageState [In, Out] extends AnyRef

    The behavior of StatefulStage is defined by these two methods, which has the same semantics as corresponding methods in PushPullStage.

  20. sealed trait SyncDirective extends Directive
  21. sealed trait TerminationDirective extends SyncDirective
  22. abstract class TimerGraphStageLogic extends GraphStageLogic
  23. abstract class TimerGraphStageLogicWithLogging extends TimerGraphStageLogic with StageLogging

    Java API: TimerGraphStageLogic with StageLogging.

  24. sealed trait UpstreamDirective extends SyncDirective
  25. abstract class AbstractStage [-In, Out, PushD <: Directive, PullD <: Directive, Ctx <: Context[Out], LifeCtx <: LifecycleContext] extends Stage[In, Out]
    Annotations
    @deprecated
    Deprecated

    (Since version 2.4.2) Please use GraphStage instead.

  26. abstract class DetachedStage [In, Out] extends AbstractStage[In, Out, UpstreamDirective, DownstreamDirective, DetachedContext[Out], LifecycleContext]

    DetachedStage can be used to implement operations similar to buffer, expand and conflate.

    DetachedStage can be used to implement operations similar to buffer, expand and conflate.

    DetachedStage implementations are boundaries between 1-bounded regions. This means that they need to enforce the "exactly one" property both on their upstream and downstream regions. As a consequence a DetachedStage can never answer an #onPull with a Context#pull or answer an #onPush with a Context#push since such an action would "steal" the event from one region (resulting in zero signals) and would inject it to the other region (resulting in two signals).

    However, DetachedStages have the ability to call akka.stream.stage.DetachedContext#hold as a response to #onPush and #onPull which temporarily takes the signal off and stops execution, at the same time putting the stage in an akka.stream.stage.DetachedContext#isHolding state. If the stage is in a holding state it contains one absorbed signal, therefore in this state the only possible command to call is akka.stream.stage.DetachedContext#pushAndPull which results in two events making the balance right again: 1 hold + 1 external event = 2 external event

    This mechanism allows synchronization between the upstream and downstream regions which otherwise can progress independently.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.4.2) Please use GraphStage instead.

    See also

    PushPullStage

  27. abstract class PushPullStage [In, Out] extends AbstractStage[In, Out, SyncDirective, SyncDirective, Context[Out], LifecycleContext]

    PushPullStage implementations participate in 1-bounded regions.

    PushPullStage implementations participate in 1-bounded regions. For every external non-completion signal these stages produce *exactly one* push or pull signal.

    #onPush is called when an element from upstream is available and there is demand from downstream, i.e. in onPush you are allowed to call Context#push to emit one element downstream, or you can absorb the element by calling Context#pull. Note that you can only emit zero or one element downstream from onPull. To emit more than one element you have to push the remaining elements from #onPull, one-by-one. onPush is not called again until onPull has requested more elements with Context#pull.

    StatefulStage has support for making it easy to emit more than one element from onPush.

    #onPull is called when there is demand from downstream, i.e. you are allowed to push one element downstream with Context#push, or request elements from upstreams with Context#pull. If you always perform transitive pull by calling ctx.pull from onPull you can use PushStage instead of PushPullStage.

    Stages are allowed to do early completion of downstream and cancel of upstream. This is done with Context#finish, which is a combination of cancel/complete.

    Since onComplete is not a backpressured signal it is sometimes preferable to push a final element and then immediately finish. This combination is exposed as Context#pushAndFinish which enables stages to propagate completion events without waiting for an extra round of pull.

    Another peculiarity is how to convert termination events (complete/failure) into elements. The problem here is that the termination events are not backpressured while elements are. This means that simply calling Context#push as a response to #onUpstreamFinish or #onUpstreamFailure will very likely break boundedness and result in a buffer overflow somewhere. Therefore the only allowed command in this case is Context#absorbTermination which stops the propagation of the termination signal, and puts the stage in a akka.stream.stage.Context#isFinishing state. Depending on whether the stage has a pending pull signal it has not yet "consumed" by a push its #onPull handler might be called immediately or later. From #onPull final elements can be pushed before completing downstream with Context#finish or Context#pushAndFinish.

    StatefulStage has support for making it easy to emit final elements.

    All these rules are enforced by types and runtime checks where needed. Always return the Directive from the call to the Context method, and do only call Context commands once per callback.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.4.2) Please use GraphStage instead.

    See also

    PushStage

    StatefulStage

    DetachedStage

  28. abstract class PushStage [In, Out] extends PushPullStage[In, Out]

    PushStage is a PushPullStage that always perform transitive pull by calling ctx.pull from onPull.

    PushStage is a PushPullStage that always perform transitive pull by calling ctx.pull from onPull.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.4.2) Please use GraphStage instead.

  29. sealed trait Stage [-In, +Out] extends AnyRef

    General interface for stream transformation.

    General interface for stream transformation.

    Custom Stage implementations are intended to be used with akka.stream.scaladsl.FlowOps#transform or akka.stream.javadsl.Flow#transform 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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.4.2) Please use GraphStage instead.

    See also

    akka.stream.javadsl.Flow#transform

    akka.stream.scaladsl.Flow#transform

  30. abstract class StatefulStage [In, Out] extends PushPullStage[In, Out]

    StatefulStage is a PushPullStage that provides convenience to make some things easier.

    StatefulStage is a PushPullStage that provides convenience to make some things easier.

    The behavior is defined in StageState instances. The initial behavior is specified by subclass implementing the #initial method. The behavior can be changed by using #become.

    Use #emit or #emitAndFinish to push more than one element from StageState#onPush or StageState#onPull.

    Use #terminationEmit to push final elements from #onUpstreamFinish or #onUpstreamFailure.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0-M2) StatefulStage is deprecated, please use GraphStage instead.

Value Members

  1. object AbstractStage

    INTERNAL API

  2. object GraphStageLogic

Ungrouped