Search Results for

    Show / Hide Table of Contents

    Class SourceGen

    Inheritance
    object
    SourceGen
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Streams.Dsl
    Assembly: Akka.Streams.dll
    Syntax
    public static class SourceGen

    Methods

    | Edit this page View Source

    UnfoldFlowWith<TOut, TState, TFlowOut, TMat>(TState, IGraph<FlowShape<TState, TFlowOut>, TMat>, Func<TFlowOut, Option<(TState, TOut)>>, TimeSpan)

    EXPERIMENTAL API

    Create a source that will unfold a value of type TState by passing it through a flow. The flow should emit an output value of type TFlowOut, that when fed to the unfolding function, generates a pair of the next state TState and output elements of type TOut.

    The timeout parameter specifies waiting time after inner flow provided by the user for unfold flow API cancels upstream, to get also the downstream cancelation(as graceful completion or failure which is propagated). If inner flow fails to complete/fail downstream, stage is failed.

    IMPORTANT CAVEAT: The given flow must not change the number of elements passing through it(i.e.it should output exactly one element for every received element). Ignoring this, will have an unpredicted result, and may result in a deadlock.

    Declaration
    public static Source<TOut, TMat> UnfoldFlowWith<TOut, TState, TFlowOut, TMat>(TState seed, IGraph<FlowShape<TState, TFlowOut>, TMat> flow, Func<TFlowOut, Option<(TState, TOut)>> unfoldWith, TimeSpan timeout)
    Parameters
    Type Name Description
    TState seed

    intial state

    IGraph<FlowShape<TState, TFlowOut>, TMat> flow

    flow through which value is passed

    Func<TFlowOut, Option<(TState, TOut)>> unfoldWith

    unfolding function

    TimeSpan timeout

    timeout

    Returns
    Type Description
    Source<TOut, TMat>
    Type Parameters
    Name Description
    TOut

    output elements type

    TState

    state type

    TFlowOut

    flow output value type

    TMat

    materialized value type

    | Edit this page View Source

    UnfoldFlow<TState, TOut, TMat>(TState, IGraph<FlowShape<TState, (TState, TOut)>, TMat>, TimeSpan)

    EXPERIMENTAL API

    Create a source that will unfold a value of type TState by passing it through a flow. The flow should emit a pair of the next state TState and output elements of type TOut. Source completes when the flow completes.

    The timeout parameter specifies waiting time after inner flow provided by the user for unfold flow API cancels upstream, to get also the downstream cancelation (as graceful completion or failure which is propagated). If inner flow fails to complete/fail downstream, stage is failed.

    IMPORTANT CAVEAT: The given flow must not change the number of elements passing through it(i.e.it should output exactly one element for every received element). Ignoring this, will have an unpredicted result, and may result in a deadlock.

    Declaration
    public static Source<TOut, TMat> UnfoldFlow<TState, TOut, TMat>(TState seed, IGraph<FlowShape<TState, (TState, TOut)>, TMat> flow, TimeSpan timeout)
    Parameters
    Type Name Description
    TState seed

    intial state

    IGraph<FlowShape<TState, (TState, TOut)>, TMat> flow

    flow, through which value is passed

    TimeSpan timeout

    timeout

    Returns
    Type Description
    Source<TOut, TMat>
    Type Parameters
    Name Description
    TState

    state type

    TOut

    output elements type

    TMat

    materialized value type

    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