Search Results for

    Show / Hide Table of Contents

    Class BackoffSupervisor

    Actor used to supervise actors with ability to restart them after back-off timeout occurred. It's designed for cases when i.e. persistent actor stops due to journal unavailability or failure. In this case it is better to wait before restart.

    Inheritance
    object
    ActorBase
    BackoffSupervisorBase
    BackoffSupervisor
    Implements
    IInternalActor
    Inherited Members
    ActorBase.AroundPreRestart(Exception, object)
    ActorBase.AroundPreStart()
    ActorBase.AroundPostRestart(Exception, object)
    ActorBase.AroundPostStop()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Pattern
    Assembly: Akka.dll
    Syntax
    public sealed class BackoffSupervisor : BackoffSupervisorBase, IInternalActor

    Constructors

    | Edit this page View Source

    BackoffSupervisor(Props, string, TimeSpan, TimeSpan, IBackoffReset, double, SupervisorStrategy, object, Func<object, bool>)

    If the arguments here change, you -must- change the invocation in BackoffOptions accordingly! Expression based props are too slow for many scenarios, so we must drop compile time safety for that sake.

    Declaration
    public BackoffSupervisor(Props childProps, string childName, TimeSpan minBackoff, TimeSpan maxBackoff, IBackoffReset reset, double randomFactor, SupervisorStrategy strategy, object replyWhileStopped = null, Func<object, bool> finalStopMessage = null)
    Parameters
    Type Name Description
    Props childProps
    string childName
    TimeSpan minBackoff
    TimeSpan maxBackoff
    IBackoffReset reset
    double randomFactor
    SupervisorStrategy strategy
    object replyWhileStopped
    Func<object, bool> finalStopMessage
    | Edit this page View Source

    BackoffSupervisor(Props, string, TimeSpan, TimeSpan, double)

    Declaration
    public BackoffSupervisor(Props childProps, string childName, TimeSpan minBackoff, TimeSpan maxBackoff, double randomFactor)
    Parameters
    Type Name Description
    Props childProps
    string childName
    TimeSpan minBackoff
    TimeSpan maxBackoff
    double randomFactor

    Methods

    | Edit this page View Source

    Props(Props, string, TimeSpan, TimeSpan, double)

    Props for creating a BackoffSupervisor actor.

    Declaration
    public static Props Props(Props childProps, string childName, TimeSpan minBackoff, TimeSpan maxBackoff, double randomFactor)
    Parameters
    Type Name Description
    Props childProps

    The Props of the child actor that will be started and supervised

    string childName

    Name of the child actor

    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

    double 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.

    Returns
    Type Description
    Props
    | Edit this page View Source

    Props(Props, string, TimeSpan, TimeSpan, double, int)

    Props for creating a BackoffSupervisor actor.

    Exceptions in the child are handled with the default supervision strategy, i.e. most exceptions will immediately restart the child. You can define another supervision strategy by using [[#propsWithSupervisorStrategy]].

    Declaration
    public static Props Props(Props childProps, string childName, TimeSpan minBackoff, TimeSpan maxBackoff, double randomFactor, int maxNrOfRetries)
    Parameters
    Type Name Description
    Props childProps

    The Props of the child actor that will be started and supervised

    string childName

    Name of the child actor

    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

    double 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.

    int maxNrOfRetries

    Maximum number of attempts to restart the child actor. The supervisor will terminate itself after the maxNoOfRetries is reached. In order to restart infinitely pass in -1.

    Returns
    Type Description
    Props
    | Edit this page View Source

    Props(BackoffOptions)

    Props for creating a BackoffSupervisor actor from BackoffOptions.

    Declaration
    public static Props Props(BackoffOptions options)
    Parameters
    Type Name Description
    BackoffOptions options

    The BackoffOptions that specify how to construct a backoff-supervisor.

    Returns
    Type Description
    Props
    | Edit this page View Source

    PropsWithSupervisorStrategy(Props, string, TimeSpan, TimeSpan, double, SupervisorStrategy)

    Props for creating a BackoffSupervisor actor with a custom supervision strategy.

    Declaration
    public static Props PropsWithSupervisorStrategy(Props childProps, string childName, TimeSpan minBackoff, TimeSpan maxBackoff, double randomFactor, SupervisorStrategy strategy)
    Parameters
    Type Name Description
    Props childProps

    The Props of the child actor that will be started and supervised

    string childName

    Name of the child actor

    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

    double 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.

    SupervisorStrategy strategy

    The supervision strategy to use for handling exceptions in the child

    Returns
    Type Description
    Props
    | Edit this page View Source

    Receive(object)

    Processor for user defined messages.

    Declaration
    protected override bool Receive(object message)
    Parameters
    Type Name Description
    object message

    The message.

    Returns
    Type Description
    bool

    TBD

    Overrides
    ActorBase.Receive(object)
    | Edit this page View Source

    SupervisorStrategy()

    TBD

    Declaration
    protected override SupervisorStrategy SupervisorStrategy()
    Returns
    Type Description
    SupervisorStrategy

    TBD

    Overrides
    ActorBase.SupervisorStrategy()

    Implements

    IInternalActor

    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