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
| Improve this Doc View SourceContext
TBD
Declaration
protected TContext Context
Field Value
Type | Description |
---|---|
TContext |
Methods
| Improve this Doc View SourceOnDownstreamFinish(TContext, Exception)
This method is called when downstream has cancelled. By default the cancel signal is immediately propagated with Akka.Streams.Stage.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 |
OnDownstreamFinish(IContext, Exception)
This method is called when downstream has cancelled. By default the cancel signal is immediately propagated with Akka.Streams.Stage.StatefulStage.Finish.
Declaration
public sealed override ITerminationDirective OnDownstreamFinish(IContext context, Exception cause)
Parameters
Type | Name | Description |
---|---|---|
IContext | context | TBD |
Exception | cause |
Returns
Type | Description |
---|---|
ITerminationDirective | TBD |
Overrides
OnPull(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 |
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
OnPush(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 |
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 sealed override IDirective OnPush(TIn element, IContext context)
Parameters
Type | Name | Description |
---|---|---|
TIn | element | TBD |
IContext | context | TBD |
Returns
Type | Description |
---|---|
IDirective | TBD |
Overrides
OnUpstreamFailure(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 |
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 sealed override ITerminationDirective OnUpstreamFailure(Exception cause, IContext context)
Parameters
Type | Name | Description |
---|---|---|
Exception | cause | TBD |
IContext | context | TBD |
Returns
Type | Description |
---|---|
ITerminationDirective | TBD |
Overrides
OnUpstreamFinish(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 Akka.Streams.Stage.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 |
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 Akka.Streams.Stage.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 sealed override ITerminationDirective OnUpstreamFinish(IContext context)
Parameters
Type | Name | Description |
---|---|---|
IContext | context | TBD |
Returns
Type | Description |
---|---|
ITerminationDirective | TBD |