Class AbstractStage<TIn, TOut, TPushDirective, TPullDirective, TContext>
TBD
Inheritance
Implements
Inherited Members
Namespace: Akka.Streams.Stage
Assembly: Akka.Streams.dll
Syntax
[Obsolete("Please use GraphStage instead. [1.1.2]")]
public abstract class AbstractStage<TIn, TOut, TPushDirective, TPullDirective, TContext> : AbstractStage<TIn, TOut>, IStage<TIn, TOut> where TPushDirective : IDirective where TPullDirective : IDirective where TContext : IContext
Type Parameters
Name | Description |
---|---|
TIn | TBD |
TOut | TBD |
TPushDirective | TBD |
TPullDirective | TBD |
TContext | TBD |
Fields
| Edit this page View SourceContext
TBD
Declaration
protected TContext Context
Field Value
Type | Description |
---|---|
TContext |
Methods
| Edit this page View SourceOnDownstreamFinish(IContext, Exception)
This method is called when downstream has cancelled. By default the cancel signal is immediately propagated with StatefulStage.Finish.
Declaration
public override sealed ITerminationDirective OnDownstreamFinish(IContext context, Exception cause)
Parameters
Type | Name | Description |
---|---|---|
IContext | context | TBD |
Exception | cause |
Returns
Type | Description |
---|---|
ITerminationDirective | TBD |
Overrides
| Edit this page View SourceOnDownstreamFinish(TContext, Exception)
This method is called when downstream has cancelled. By default the cancel signal is immediately propagated with StatefulStage.Finish.
Declaration
public virtual ITerminationDirective OnDownstreamFinish(TContext context, Exception cause)
Parameters
Type | Name | Description |
---|---|---|
TContext | context | TBD |
Exception | cause |
Returns
Type | Description |
---|---|
ITerminationDirective | TBD |
OnPull(IContext)
This method is called when there is demand from downstream, i.e. you are allowed to push one element downstreams with Push(object), or request elements from upstreams with Pull()
Declaration
public override IDirective OnPull(IContext context)
Parameters
Type | Name | Description |
---|---|---|
IContext | context | TBD |
Returns
Type | Description |
---|---|
IDirective | TBD |
Overrides
| Edit this page View SourceOnPull(TContext)
This method is called when there is demand from downstream, i.e. you are allowed to push one element downstreams with Push(object), or request elements from upstreams with Pull()
Declaration
public abstract TPullDirective OnPull(TContext context)
Parameters
Type | Name | Description |
---|---|---|
TContext | context | TBD |
Returns
Type | Description |
---|---|
TPullDirective | TBD |
OnPush(TIn, IContext)
This method is called when an element from upstream is available and there is demand from downstream, i.e. in OnPush(TIn, TContext) you are allowed to call Push(object) to emit one element downstreams, or you can absorb the element by calling Pull(). Note that you can only emit zero or one element downstream from OnPull(TContext).
To emit more than one element you have to push the remaining elements from OnPull(TContext), one-by-one. OnPush(TIn, TContext) is not called again until OnPull(TContext) has requested more elements with Pull().
Declaration
public override sealed IDirective OnPush(TIn element, IContext context)
Parameters
Type | Name | Description |
---|---|---|
TIn | element | TBD |
IContext | context | TBD |
Returns
Type | Description |
---|---|
IDirective | TBD |
Overrides
| Edit this page View SourceOnPush(TIn, TContext)
This method is called when an element from upstream is available and there is demand from downstream, i.e. in OnPush(TIn, TContext) you are allowed to call Push(object) to emit one element downstreams, or you can absorb the element by calling Pull(). Note that you can only emit zero or one element downstream from OnPull(TContext).
To emit more than one element you have to push the remaining elements from OnPull(TContext), one-by-one. OnPush(TIn, TContext) is not called again until OnPull(TContext) has requested more elements with Pull().
Declaration
public abstract TPushDirective OnPush(TIn element, TContext context)
Parameters
Type | Name | Description |
---|---|---|
TIn | element | TBD |
TContext | context | TBD |
Returns
Type | Description |
---|---|
TPushDirective | TBD |
OnUpstreamFailure(Exception, IContext)
OnUpstreamFailure(Exception, IContext) is called when upstream has signaled that the stream is completed with failure. It is not called if OnPull(TContext) or OnPush(TIn, TContext) of the stage itself throws an exception.
Note that elements that were emitted by upstream before the failure happened might not have been received by this stage when OnUpstreamFailure(Exception, IContext) is called, i.e. failures are not backpressured and might be propagated as soon as possible.
Here you cannot call Push(object), because there might not be any demand from downstream. To emit additional elements before terminating you can use AbsorbTermination() and push final elements from OnPull(TContext). The stage will then be in finishing state, which can be checked with IsFinishing.
Declaration
public override sealed ITerminationDirective OnUpstreamFailure(Exception cause, IContext context)
Parameters
Type | Name | Description |
---|---|---|
Exception | cause | TBD |
IContext | context | TBD |
Returns
Type | Description |
---|---|
ITerminationDirective | TBD |
Overrides
| Edit this page View SourceOnUpstreamFailure(Exception, TContext)
OnUpstreamFailure(Exception, IContext) is called when upstream has signaled that the stream is completed with failure. It is not called if OnPull(TContext) or OnPush(TIn, TContext) of the stage itself throws an exception.
Note that elements that were emitted by upstream before the failure happened might not have been received by this stage when OnUpstreamFailure(Exception, IContext) is called, i.e. failures are not backpressured and might be propagated as soon as possible.
Here you cannot call Push(object), because there might not be any demand from downstream. To emit additional elements before terminating you can use AbsorbTermination() and push final elements from OnPull(TContext). The stage will then be in finishing state, which can be checked with IsFinishing.
Declaration
public virtual ITerminationDirective OnUpstreamFailure(Exception cause, TContext context)
Parameters
Type | Name | Description |
---|---|---|
Exception | cause | TBD |
TContext | context | TBD |
Returns
Type | Description |
---|---|
ITerminationDirective | TBD |
OnUpstreamFinish(IContext)
This method is called when upstream has signaled that the stream is successfully completed. Here you cannot call Push(object), because there might not be any demand from downstream. To emit additional elements before terminating you can use AbsorbTermination() and push final elements from OnPull(TContext). The stage will then be in finishing state, which can be checked with IsFinishing.
By default the finish signal is immediately propagated with StatefulStage.Finish.
IMPORTANT NOTICE: this signal is not back-pressured, it might arrive from upstream even though the last action by this stage was a "push".
Declaration
public override sealed ITerminationDirective OnUpstreamFinish(IContext context)
Parameters
Type | Name | Description |
---|---|---|
IContext | context | TBD |
Returns
Type | Description |
---|---|
ITerminationDirective | TBD |
Overrides
| Edit this page View SourceOnUpstreamFinish(TContext)
This method is called when upstream has signaled that the stream is successfully completed. Here you cannot call Push(object), because there might not be any demand from downstream. To emit additional elements before terminating you can use AbsorbTermination() and push final elements from OnPull(TContext). The stage will then be in finishing state, which can be checked with IsFinishing.
By default the finish signal is immediately propagated with StatefulStage.Finish.
IMPORTANT NOTICE: this signal is not back-pressured, it might arrive from upstream even though the last action by this stage was a "push".
Declaration
public virtual ITerminationDirective OnUpstreamFinish(TContext context)
Parameters
Type | Name | Description |
---|---|---|
TContext | context | TBD |
Returns
Type | Description |
---|---|
ITerminationDirective | TBD |