Search Results for

    Show / Hide Table of Contents

    Class RetrySupport

    This class provides the retry utility functions.

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

    Methods

    | Edit this page View Source

    Retry<T>(Func<Task<T>>, int)

    Given a function, returns an internally retrying Task. The first attempt will be made immediately, each subsequent attempt will be made immediately if the previous attempt failed.

    If attempts are exhausted the returned Task is simply the result of invoking attempt.
    Declaration
    public static Task<T> Retry<T>(Func<Task<T>> attempt, int attempts)
    Parameters
    Type Name Description
    Func<Task<T>> attempt

    TBD

    int attempts

    TBD

    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T
    | Edit this page View Source

    Retry<T>(Func<Task<T>>, int, Func<int, Option<TimeSpan>>, IScheduler)

    Given a function, returns an internally retrying Task. The first attempt will be made immediately, each subsequent attempt will be made after the 'delay' return by `delayFunction`(the input next attempt count start from 1). Returns None for no delay. A scheduler (eg Context.System.Scheduler) must be provided to delay each retry. You could provide a function to generate the next delay duration after first attempt, this function should never return `null`, otherwise an InvalidOperationException will be through.

    If attempts are exhausted the returned Task is simply the result of invoking attempt.
    Declaration
    public static Task<T> Retry<T>(Func<Task<T>> attempt, int attempts, Func<int, Option<TimeSpan>> delayFunction, IScheduler scheduler)
    Parameters
    Type Name Description
    Func<Task<T>> attempt

    TBD

    int attempts

    TBD

    Func<int, Option<TimeSpan>> delayFunction

    TBD

    IScheduler scheduler

    The scheduler instance to use.

    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T
    | Edit this page View Source

    Retry<T>(Func<Task<T>>, int, TimeSpan, IScheduler)

    Given a function, returns an internally retrying Task. The first attempt will be made immediately, each subsequent attempt will be made after 'delay'. A scheduler (eg Context.System.Scheduler) must be provided to delay each retry.

    If attempts are exhausted the returned future is simply the result of invoking attempt.
    Declaration
    public static Task<T> Retry<T>(Func<Task<T>> attempt, int attempts, TimeSpan delay, IScheduler scheduler)
    Parameters
    Type Name Description
    Func<Task<T>> attempt

    TBD

    int attempts

    TBD

    TimeSpan delay

    TBD

    IScheduler scheduler

    The scheduler instance to use.

    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T
    | Edit this page View Source

    Retry<T>(Func<Task<T>>, int, TimeSpan, TimeSpan, int, IScheduler)

    Given a function, returns an internally retrying Task. The first attempt will be made immediately, each subsequent attempt will be made with a backoff time, if the previous attempt failed.

    If attempts are exhausted the returned Task is simply the result of invoking attempt.
    Declaration
    public static Task<T> Retry<T>(Func<Task<T>> attempt, int attempts, TimeSpan minBackoff, TimeSpan maxBackoff, int randomFactor, IScheduler scheduler)
    Parameters
    Type Name Description
    Func<Task<T>> attempt

    TBD

    int attempts

    TBD

    TimeSpan minBackoff

    minimum (initial) duration until the child actor will started again, if it is terminated.

    TimeSpan maxBackoff

    the exponential back-off is capped to this duration.

    int randomFactor

    after calculation of the exponential back-off an additional random delay based on this factor is added, e.g. 0.2 adds up to 20% delay. In order to skip this additional delay pass in 0.

    IScheduler scheduler

    The scheduler instance to use.

    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T
    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