Search Results for

    Show / Hide Table of Contents

    Class AbstractStage<TIn, TOut>

    TBD

    Inheritance
    object
    AbstractStage<TIn, TOut>
    AbstractStage<TIn, TOut, TPushDirective, TPullDirective, TContext>
    Implements
    IStage<TIn, TOut>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Streams.Stage
    Assembly: Akka.Streams.dll
    Syntax
    [Obsolete("Please use GraphStage instead. [1.1.2]")]
    public abstract class AbstractStage<TIn, TOut> : IStage<TIn, TOut>
    Type Parameters
    Name Description
    TIn

    TBD

    TOut

    TBD

    Properties

    | Edit this page View Source

    IsDetached

    TBD

    Declaration
    protected virtual bool IsDetached { get; }
    Property Value
    Type Description
    bool

    Methods

    | Edit this page View Source

    Decide(Exception)

    If an exception is thrown from OnPush(TIn, IContext) this method is invoked to decide how to handle the exception. By default this method returns Stop.

    If an exception is thrown from OnPull(IContext) the stream will always be completed with failure, because it is not always possible to recover from that state. In concrete stages it is of course possible to use ordinary try-catch-recover inside OnPull(IContext) when it is know how to recover from such exceptions.

    Declaration
    public virtual Directive Decide(Exception cause)
    Parameters
    Type Name Description
    Exception cause

    TBD

    Returns
    Type Description
    Directive

    TBD

    | Edit this page View Source

    OnDownstreamFinish(IContext, Exception)

    This method is called when downstream has cancelled. By default the cancel signal is immediately propagated with StatefulStage.Finish.

    Declaration
    public abstract ITerminationDirective OnDownstreamFinish(IContext context, Exception cause)
    Parameters
    Type Name Description
    IContext context

    TBD

    Exception cause
    Returns
    Type Description
    ITerminationDirective

    TBD

    | Edit this page View Source

    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 abstract IDirective OnPull(IContext context)
    Parameters
    Type Name Description
    IContext context

    TBD

    Returns
    Type Description
    IDirective

    TBD

    | Edit this page View Source

    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, IContext) 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(IContext).

    To emit more than one element you have to push the remaining elements from OnPull(IContext), one-by-one. OnPush(TIn, IContext) is not called again until OnPull(IContext) has requested more elements with Pull().

    Declaration
    public abstract IDirective OnPush(TIn element, IContext context)
    Parameters
    Type Name Description
    TIn element

    TBD

    IContext context

    TBD

    Returns
    Type Description
    IDirective

    TBD

    | Edit this page View Source

    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(IContext) or OnPush(TIn, IContext) 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(IContext). The stage will then be in finishing state, which can be checked with IsFinishing.

    Declaration
    public abstract ITerminationDirective OnUpstreamFailure(Exception cause, IContext context)
    Parameters
    Type Name Description
    Exception cause

    TBD

    IContext context

    TBD

    Returns
    Type Description
    ITerminationDirective

    TBD

    | Edit this page View Source

    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(IContext). 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 abstract ITerminationDirective OnUpstreamFinish(IContext context)
    Parameters
    Type Name Description
    IContext context

    TBD

    Returns
    Type Description
    ITerminationDirective

    TBD

    | Edit this page View Source

    PostStop()

    User overridable callback. Is called after the Stages final action is performed.
    Empty default implementation.

    Declaration
    public virtual void PostStop()
    | Edit this page View Source

    PreStart(ILifecycleContext)

    User overridable callback.

    It is called before any other method defined on the IStage<TIn, TOut>. Empty default implementation.

    Declaration
    public virtual void PreStart(ILifecycleContext context)
    Parameters
    Type Name Description
    ILifecycleContext context

    TBD

    | Edit this page View Source

    Restart()

    Used to create a fresh instance of the stage after an error resulting in a Restart directive. By default it will return the same instance untouched, so you must override it if there are any state that should be cleared before restarting, e.g. by returning a new instance.

    Declaration
    public virtual IStage<TIn, TOut> Restart()
    Returns
    Type Description
    IStage<TIn, TOut>

    TBD

    Implements

    IStage<TIn, TOut>

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET