Search Results for

    Show / Hide Table of Contents

    Class StatefulStage<TIn, TOut>

    StatefulStage<TIn, TOut> is a PushPullStage<TIn, TOut> that provides convenience to make some things easier.

    The behavior is defined in StageState<TIn, TOut> instances. The initial behavior is specified by subclass implementing the Initial method. The behavior can be changed by using Become(StageState<TIn, TOut>).

    Use Emit(IEnumerator<TOut>, IContext<TOut>, StageState<TIn, TOut>) or EmitAndFinish(IEnumerator<TOut>, IContext<TOut>) to push more than one element from OnPush(TIn, IContext<TOut>) or OnPull(IContext<TOut>).

    Use TerminationEmit(IEnumerator<TOut>, IContext<TOut>) to push final elements from OnUpstreamFinish(IContext<TOut>) or OnUpstreamFailure(Exception, IContext).

    Inheritance
    object
    AbstractStage<TIn, TOut>
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>
    PushPullStage<TIn, TOut>
    StatefulStage<TIn, TOut>
    Implements
    IStage<TIn, TOut>
    Inherited Members
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.Context
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.OnPush(TIn, IContext<TOut>)
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.OnPush(TIn, IContext)
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.OnPull(IContext<TOut>)
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.OnPull(IContext)
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.OnUpstreamFinish(IContext)
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.OnUpstreamFinish(IContext<TOut>)
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.OnDownstreamFinish(IContext, Exception)
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.OnDownstreamFinish(IContext<TOut>, Exception)
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.OnUpstreamFailure(Exception, IContext)
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.OnUpstreamFailure(Exception, IContext<TOut>)
    AbstractStage<TIn, TOut>.IsDetached
    AbstractStage<TIn, TOut>.PreStart(ILifecycleContext)
    AbstractStage<TIn, TOut>.OnPush(TIn, IContext)
    AbstractStage<TIn, TOut>.OnPull(IContext)
    AbstractStage<TIn, TOut>.OnUpstreamFinish(IContext)
    AbstractStage<TIn, TOut>.OnDownstreamFinish(IContext, Exception)
    AbstractStage<TIn, TOut>.OnUpstreamFailure(Exception, IContext)
    AbstractStage<TIn, TOut>.PostStop()
    AbstractStage<TIn, TOut>.Decide(Exception)
    AbstractStage<TIn, TOut>.Restart()
    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.0]")]
    public abstract class StatefulStage<TIn, TOut> : PushPullStage<TIn, TOut>, IStage<TIn, TOut>
    Type Parameters
    Name Description
    TIn

    TBD

    TOut

    TBD

    Constructors

    | Edit this page View Source

    StatefulStage(StageState<TIn, TOut>)

    TBD

    Declaration
    protected StatefulStage(StageState<TIn, TOut> current)
    Parameters
    Type Name Description
    StageState<TIn, TOut> current

    TBD

    Properties

    | Edit this page View Source

    Current

    Current state.

    Declaration
    public StageState<TIn, TOut> Current { get; }
    Property Value
    Type Description
    StageState<TIn, TOut>
    | Edit this page View Source

    Initial

    Concrete subclass must return the initial behavior from this method. Warning: This method must not be implemented as val.

    Declaration
    public abstract StageState<TIn, TOut> Initial { get; }
    Property Value
    Type Description
    StageState<TIn, TOut>

    Methods

    | Edit this page View Source

    Become(StageState<TIn, TOut>)

    Change the behavior to another StageState<TIn, TOut>.

    Declaration
    public void Become(StageState<TIn, TOut> state)
    Parameters
    Type Name Description
    StageState<TIn, TOut> state

    TBD

    Exceptions
    Type Condition
    ArgumentNullException

    This exception is thrown when the specified state is undefined.

    | Edit this page View Source

    Emit(IEnumerator<TOut>, IContext<TOut>)

    Can be used from OnPush(TIn, IContext<TOut>) or OnPull(IContext<TOut>) to push more than one element downstream.

    Declaration
    public ISyncDirective Emit(IEnumerator<TOut> enumerator, IContext<TOut> context)
    Parameters
    Type Name Description
    IEnumerator<TOut> enumerator

    TBD

    IContext<TOut> context

    TBD

    Returns
    Type Description
    ISyncDirective

    TBD

    | Edit this page View Source

    Emit(IEnumerator<TOut>, IContext<TOut>, StageState<TIn, TOut>)

    Can be used from OnPush(TIn, IContext<TOut>) or OnPull(IContext<TOut>) to push more than one element downstream and after that change behavior.

    Declaration
    public ISyncDirective Emit(IEnumerator<TOut> enumerator, IContext<TOut> context, StageState<TIn, TOut> nextState)
    Parameters
    Type Name Description
    IEnumerator<TOut> enumerator

    TBD

    IContext<TOut> context

    TBD

    StageState<TIn, TOut> nextState

    TBD

    Returns
    Type Description
    ISyncDirective

    TBD

    Exceptions
    Type Condition
    IllegalStateException

    This exception is thrown when either currently in the emitting state or the specified enumerator is empty.

    | Edit this page View Source

    EmitAndFinish(IEnumerator<TOut>, IContext<TOut>)

    Can be used from OnPush(TIn, IContext<TOut>) or OnPull(IContext<TOut>) to push more than one element downstream and after that finish (complete downstream, cancel upstreams).

    Declaration
    public ISyncDirective EmitAndFinish(IEnumerator<TOut> enumerator, IContext<TOut> context)
    Parameters
    Type Name Description
    IEnumerator<TOut> enumerator

    TBD

    IContext<TOut> context

    TBD

    Returns
    Type Description
    ISyncDirective

    TBD

    Exceptions
    Type Condition
    IllegalStateException

    This exception is thrown when either currently in the emitting state or the specified enumerator is empty.

    | Edit this page View Source

    OnPull(IContext<TOut>)

    Invokes current state.

    Declaration
    public override sealed ISyncDirective OnPull(IContext<TOut> context)
    Parameters
    Type Name Description
    IContext<TOut> context

    TBD

    Returns
    Type Description
    ISyncDirective

    TBD

    Overrides
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.OnPull(IContext<TOut>)
    | Edit this page View Source

    OnPush(TIn, IContext<TOut>)

    Invokes current state.

    Declaration
    public override sealed ISyncDirective OnPush(TIn element, IContext<TOut> context)
    Parameters
    Type Name Description
    TIn element

    TBD

    IContext<TOut> context

    TBD

    Returns
    Type Description
    ISyncDirective

    TBD

    Overrides
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.OnPush(TIn, IContext<TOut>)
    | Edit this page View Source

    OnUpstreamFinish(IContext<TOut>)

    TBD

    Declaration
    public override ITerminationDirective OnUpstreamFinish(IContext<TOut> context)
    Parameters
    Type Name Description
    IContext<TOut> context

    TBD

    Returns
    Type Description
    ITerminationDirective

    TBD

    Overrides
    AbstractStage<TIn, TOut, ISyncDirective, ISyncDirective, IContext<TOut>>.OnUpstreamFinish(IContext<TOut>)
    | Edit this page View Source

    TerminationEmit(IEnumerator<TOut>, IContext<TOut>)

    Can be used from OnUpstreamFinish(IContext<TOut>) to push final elements downstream before completing the stream successfully. Note that if this is used from OnUpstreamFailure(Exception, IContext) the failure will be absorbed and the stream will be completed successfully.

    Declaration
    public ISyncDirective TerminationEmit(IEnumerator<TOut> enumerator, IContext<TOut> context)
    Parameters
    Type Name Description
    IEnumerator<TOut> enumerator

    TBD

    IContext<TOut> context

    TBD

    Returns
    Type Description
    ISyncDirective

    TBD

    Exceptions
    Type Condition
    IllegalStateException

    This exception is thrown when the specified enumerator is empty.

    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