Search Results for

    Show / Hide Table of Contents

    Class Retry

    Inheritance
    object
    Retry
    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 Retry

    Methods

    | Edit this page View Source

    Concat<TIn, TState, TOut, TMat>(long, IGraph<FlowShape<(TIn, TState), (Result<TOut>, TState)>, TMat>, Func<TState, IEnumerable<(TIn, TState)>>)

    EXPERIMENTAL API

    Factory for multiple retries flow. similar to the simple retry, but this will allow to break down a "heavy" element which failed into multiple "thin" elements, that may succeed individually. Since it's easy to inflate elements in retry cycle, there's also a limit parameter, that will limit the amount of generated elements by the `retryWith` function, and will fail the stage if that limit is exceeded.

    Passing `null` is valid, and will result in filtering out the failure quietly, without emitting a failed Result<T> element.

    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 IGraph<FlowShape<(TIn, TState), (Result<TOut>, TState)>, TMat> Concat<TIn, TState, TOut, TMat>(long limit, IGraph<FlowShape<(TIn, TState), (Result<TOut>, TState)>, TMat> flow, Func<TState, IEnumerable<(TIn, TState)>> retryWith)
    Parameters
    Type Name Description
    long limit

    since every retry can generate more elements, the inner queue can get too big. if the limit is reached, the stage will fail.

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

    the flow to retry

    Func<TState, IEnumerable<(TIn, TState)>> retryWith

    if output was failure, we can optionaly recover from it, and retry with a sequence of input and new state pairs we get from this function.

    Returns
    Type Description
    IGraph<FlowShape<(TIn, TState), (Result<TOut>, TState)>, TMat>
    Type Parameters
    Name Description
    TIn

    input elements type

    TState

    state to create a new (I,S) to retry with

    TOut

    output elements type

    TMat

    materialized value type

    | Edit this page View Source

    Create<TIn, TState, TOut, TMat>(IGraph<FlowShape<(TIn, TState), (Result<TOut>, TState)>, TMat>, Func<TState, Option<(TIn, TState)>>)

    EXPERIMENTAL API

    Retry flow factory. given a flow that produces Result<T>s, this wrapping flow may be used to try and pass failed elements through the flow again. More accurately, the given flow consumes a tuple of `input` and `state`, and produces a tuple of Result<T> of `output` and `state`. If the flow emits a failed element (i.e. IsSuccess is false), the retryWith function is fed with the `state` of the failed element, and may produce a new input-state tuple to pass through the original flow. The function may also yield `Option.None` instead of `(input, state)`, which means not to retry a failed element.

    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 IGraph<FlowShape<(TIn, TState), (Result<TOut>, TState)>, TMat> Create<TIn, TState, TOut, TMat>(IGraph<FlowShape<(TIn, TState), (Result<TOut>, TState)>, TMat> flow, Func<TState, Option<(TIn, TState)>> retryWith)
    Parameters
    Type Name Description
    IGraph<FlowShape<(TIn, TState), (Result<TOut>, TState)>, TMat> flow

    the flow to retry

    Func<TState, Option<(TIn, TState)>> retryWith

    if output was failure, we can optionaly recover from it, and retry with a new pair of input and new state we get from this function.

    Returns
    Type Description
    IGraph<FlowShape<(TIn, TState), (Result<TOut>, TState)>, TMat>
    Type Parameters
    Name Description
    TIn

    input elements type

    TState

    state to create a new (I,S) to retry with

    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