Akka.Streams.Stage Namespace |
Class | Description | |
---|---|---|
AbstractStageTIn, TOut | Obsolete.
TBD
| |
AbstractStageTIn, TOut, TPushDirective, TPullDirective, TContext | Obsolete.
TBD
| |
ConditionalTerminateInput |
Input handler that terminates the state upon receiving completion
if the given condition holds at that time.The stage fails upon receiving a failure.
| |
ConditionalTerminateOutput |
Output handler that terminates the state upon receiving completion if the
given condition holds at that time.The stage fails upon receiving a failure.
| |
DetachedStageTIn, TOut | Obsolete.
DetachedStage can be used to implement operations similar to BufferTIn, TOut, TMat(FlowTIn, TOut, TMat, Int32, OverflowStrategy),
ExpandTIn, TOut1, TOut2, TMat(FlowTIn, TOut1, TMat, FuncTOut1, IEnumeratorTOut2) and ConflateTIn, TOut, TMat(FlowTIn, TOut, TMat, FuncTOut, TOut, TOut).
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(IContext) with a Pull or answer an OnPush(TIn, IContext) with a Push(Object) 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 HoldUpstream and HoldDownstream as a response to
OnPush(TIn, IContext) and OnPull(IContext) which temporarily takes the signal off and
stops execution, at the same time putting the stage in an IsHoldingBoth 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(Object) 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.
@see PushPullStageTIn, TOut | |
EagerTerminateInput |
Input handler that terminates the stage upon receiving completion. The stage fails upon receiving a failure.
| |
EagerTerminateOutput |
Output handler that terminates the stage upon cancellation.
| |
FreeDirective |
TBD
| |
GraphStageTShape |
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.
| |
GraphStageLogic |
Represents the processing logic behind a GraphStageTShape. 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 GraphStageTShape * 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 always stopped once all its input and output ports have been closed, i.e. it is not possible to keep the stage alive for further processing once it does not have any open ports. | |
GraphStageLogicLambdaInHandler |
TBD
| |
GraphStageLogicLambdaOutHandler |
TBD
| |
GraphStageLogicSubSinkInletT |
INTERNAL API
This allows the dynamic creation of an Inlet for a GraphStage which is
connected to a Sink that is available for materialization (e.g. using
the SubFusingMaterializer). Care needs to be taken to cancel this Inlet
when the stage shuts down lest the corresponding Sink be left hanging.
| |
GraphStageLogicSubSourceOutletT |
INTERNAL API
This allows the dynamic creation of an Outlet for a GraphStage which is
connected to a Source that is available for materialization (e.g. using
the SubFusingMaterializer). Care needs to be taken to complete this
Outlet when the stage shuts down lest the corresponding Sink be left
hanging. It is good practice to use the Timeout(TimeSpan) method to cancel this
Outlet in case the corresponding Source is not materialized within a
given time limit, see e.g. ActorMaterializerSettings.
| |
GraphStageWithMaterializedValueTShape, TMaterialized |
TBD
| |
IgnoreTerminateInput |
Input handler that does not terminate the stage upon receiving completion. The stage fails upon receiving a failure.
| |
IgnoreTerminateOutput |
Output handler that does not terminate the stage upon cancellation.
| |
InAndOutGraphStageLogic |
A GraphStageLogic that implements IInHandler and IOutHandler.
OnUpstreamFinish calls CompleteStageOnUpstreamFailure(Exception) calls FailStage(Exception)OnDownstreamFinish calls CompleteStage | |
InAndOutHandler |
Collection of callbacks for an output port of a GraphStageTShape and
for an input port of a GraphStageTShape | |
InGraphStageLogic |
A GraphStageLogic that implements IInHandler.
OnUpstreamFinish calls CompleteStageOnUpstreamFailure(Exception) calls FailStage(Exception) | |
InHandler |
Collection of callbacks for an input port of a GraphStageTShape | |
OutGraphStageLogic | ||
OutHandler |
Collection of callbacks for an output port of a GraphStageTShape | |
PushPullGraphStageTIn, TOut |
TBD
| |
PushPullGraphStageWithMaterializedValueTIn, TOut, TMat |
TBD
| |
PushPullStageTIn, TOut | Obsolete. PushPullStageTIn, TOut implementations participate in 1-bounded regions. For every external non-completion signal these stages produce *exactly one* push or pull signal. OnPush(TIn, IContext) is called when an element from upstream is available and there is demand from downstream, i.e. in OnPush(TIn, IContext) you are allowed to call Push(Object) to emit one element downstream, or you can absorb the element by calling Pull. Note that you can only emit zero or one element downstream from OnPull(IContext). To emit more than one element you have to push the remaining elements from OnPush(TIn, IContext), one-by-one. OnPush(TIn, IContext) is not called again until OnPull(IContext) has requested more elements with Pull. StatefulStageTIn, TOut has support for making it easy to emit more than one element from OnPush(TIn, IContext). OnPull(IContext)> is called when there is demand from downstream, i.e. you are allowed to push one element downstream with Push(Object), or request elements from upstreams with Pull. If you always perform transitive pull by calling Pull from OnPull(IContext) you can use PushStageTIn, TOut instead of PushPullStageTIn, TOut. Stages are allowed to do early completion of downstream and cancel of upstream. This is done with 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 PushAndFinish(Object) 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 Push(Object) as a response to OnUpstreamFinish(IContext) or OnUpstreamFailure(Exception, IContext) will very likely break boundedness and result in a buffer overflow somewhere. Therefore the only allowed command in this case is AbsorbTermination which stops the propagation of the termination signal, and puts the stage in a IsFinishing state. Depending on whether the stage has a pending pull signal it has not yet "consumed" by a push its OnPull(IContext) handler might be called immediately or later. From OnPull(IContext) final elements can be pushed before completing downstream with Finish or PushAndFinish(Object). StatefulStageTIn, TOut 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 IContext method, and do only call IContext commands once per callback. | |
PushStageTIn, TOut | Obsolete. PushStageTIn, TOut is a PushPullStageTIn, TOut that always perform transitive pull by calling Pull from OnPull(IContextTOut).
| |
StageActorRef |
Minimal actor to work with other actors and watch them in a synchronous ways.
| |
StageActorRefNotInitializedException |
TBD
| |
StageStateTIn, TOut |
The behavior of StatefulStageTIn, TOut is defined by these two methods, which
has the same semantics as corresponding methods in PushPullStageTIn, TOut.
| |
StatefulStage |
TBD
| |
StatefulStageTIn, TOut | Obsolete. StatefulStageTIn, TOut is a PushPullStageTIn, TOut that provides convenience to make some things easier.
The behavior is defined in StageStateTIn, TOut instances. The initial behavior is specified
by subclass implementing the Initial method. The behavior can be changed by using Become(StageStateTIn, TOut).
Use Emit(IEnumeratorTOut, IContextTOut, StageStateTIn, TOut) or EmitAndFinish(IEnumeratorTOut, IContextTOut) to push more than one element from OnPush(TIn, IContextTOut) or
OnPull(IContextTOut).
Use TerminationEmit(IEnumeratorTOut, IContextTOut) to push final elements from OnUpstreamFinish(IContextTOut) or OnUpstreamFailure(Exception, IContext).
| |
TimerGraphStageLogic |
TBD
| |
TotallyIgnorantInput |
Input handler that does not terminate the stage upon receiving completion nor failure.
|
Structure | Description | |
---|---|---|
LogicAndMaterializedValueTMaterialized |
TBD
|
Interface | Description | |
---|---|---|
IAsyncContext |
This kind of context is available to IAsyncContextTOut, TExt. It implements the same
interface as for IDetachedContext with the addition of being able to obtain
AsyncCallback objects that allow the registration of asynchronous notifications.
| |
IAsyncContextTOut, TExt |
TBD
| |
IAsyncDirective |
TBD
| |
IBoundaryContext |
TBD
| |
IContext |
Passed to the callback methods of PushPullStageTIn, TOut and StatefulStageTIn, TOut.
| |
IContextTOut |
TBD
| |
IDetachedContext |
Passed to the callback methods of DetachedStageTIn, TOut.
HoldDownstream and HoldUpstream 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(Object) which results in two
events making the balance right again: 1 hold + 1 external event = 2 external event
| |
IDetachedContextTOut |
TBD
| |
IDirective |
TBD
| |
IDownstreamDirective |
TBD
| |
IGraphStageWithMaterializedValueTShape, TMaterialized |
TBD
| |
IInHandler |
Collection of callbacks for an input port of a GraphStageTShape | |
ILifecycleContext |
TBD
| |
ILogicAndMaterializedValueTMaterialized |
TBD
| |
IOutHandler |
Collection of callbacks for an output port of a GraphStageTShape | |
IStageTIn, TOut | Obsolete.
General interface for stream transformation.
Custom IStageTIn, TOut implementations are intended to be used with
TransformTIn, TOut1, TOut2, TMat(FlowTIn, TOut1, TMat, FuncIStageTOut1, TOut2) to extend the FlowOperations API when there
is no specialized operator that performs the transformation.
Custom implementations are subclasses of PushPullStageTIn, TOut or
DetachedStageTIn, TOut. Sometimes it is convenient to extend
StatefulStageTIn, TOut for support of become like behavior.
It is possible to keep state in the concrete IStageTIn, TOut instance with
ordinary instance variables. The ITransformerLikeTIn, TOut 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.
| |
ISyncDirective |
TBD
| |
ITerminationDirective |
TBD
| |
IUpstreamDirective |
TBD
|
Delegate | Description | |
---|---|---|
AsyncCallback |
TBD
| |
AsyncCallbackT |
An asynchronous callback holder that is attached to an IAsyncContextTOut, TExt.
Invoking [!:Invoke] will eventually lead to OnAsyncInput
being called.
Dispatch an asynchronous notification. This method is thread-safe and
may be invoked from external execution contexts.
| |
StageActorRefReceive |
TBD
|