Search Results for

    Show / Hide Table of Contents

    Class OneForOneStrategy

    This class represents a fault handling strategy that applies a Directive to the single child actor that failed.

    Inheritance
    object
    SupervisorStrategy
    OneForOneStrategy
    ClusterMetricsStrategy
    Implements
    ISurrogated
    IEquatable<OneForOneStrategy>
    Inherited Members
    SupervisorStrategy.HandleFailure(ActorCell, IActorRef, Exception, ChildRestartStats, IReadOnlyCollection<ChildRestartStats>)
    SupervisorStrategy.DefaultDecider
    SupervisorStrategy.RestartChild(IActorRef, Exception, bool)
    SupervisorStrategy.ResumeChild(IActorRef, Exception)
    SupervisorStrategy.LogFailure(IActorContext, IActorRef, Exception, Directive)
    SupervisorStrategy.LoggingEnabled
    SupervisorStrategy.DefaultStrategy
    SupervisorStrategy.StoppingStrategy
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Actor
    Assembly: Akka.dll
    Syntax
    public class OneForOneStrategy : SupervisorStrategy, ISurrogated, IEquatable<OneForOneStrategy>

    Constructors

    | Edit this page View Source

    OneForOneStrategy()

    Initializes a new instance of the OneForOneStrategy class.

    Declaration
    protected OneForOneStrategy()
    | Edit this page View Source

    OneForOneStrategy(IDecider)

    Initializes a new instance of the OneForOneStrategy class.

    Declaration
    public OneForOneStrategy(IDecider decider)
    Parameters
    Type Name Description
    IDecider decider

    TBD

    | Edit this page View Source

    OneForOneStrategy(Func<Exception, Directive>)

    Initializes a new instance of the OneForOneStrategy class.

    Declaration
    public OneForOneStrategy(Func<Exception, Directive> localOnlyDecider)
    Parameters
    Type Name Description
    Func<Exception, Directive> localOnlyDecider

    mapping from Exception to Directive

    | Edit this page View Source

    OneForOneStrategy(Func<Exception, Directive>, bool)

    Initializes a new instance of the OneForOneStrategy class.

    Declaration
    public OneForOneStrategy(Func<Exception, Directive> localOnlyDecider, bool loggingEnabled = true)
    Parameters
    Type Name Description
    Func<Exception, Directive> localOnlyDecider

    The mapping used to translate an Exception to a Directive.

    bool loggingEnabled

    If true failures will be logged

    | Edit this page View Source

    OneForOneStrategy(int, int, IDecider, bool)

    Initializes a new instance of the OneForOneStrategy class.

    Declaration
    public OneForOneStrategy(int maxNrOfRetries, int withinTimeMilliseconds, IDecider decider, bool loggingEnabled = true)
    Parameters
    Type Name Description
    int maxNrOfRetries

    The number of times a child actor is allowed to be restarted, negative value means no limit, if the limit is exceeded the child actor is stopped.

    int withinTimeMilliseconds

    duration in milliseconds of the time window for maxNrOfRetries, negative values means no window.

    IDecider decider

    The mapping used to translate an Exception to a Directive.

    bool loggingEnabled

    If true failures will be logged

    | Edit this page View Source

    OneForOneStrategy(int, int, Func<Exception, Directive>, bool)

    Initializes a new instance of the OneForOneStrategy class.

    Declaration
    public OneForOneStrategy(int maxNrOfRetries, int withinTimeMilliseconds, Func<Exception, Directive> localOnlyDecider, bool loggingEnabled = true)
    Parameters
    Type Name Description
    int maxNrOfRetries

    The number of times a child actor is allowed to be restarted, negative value means no limit, if the limit is exceeded the child actor is stopped.

    int withinTimeMilliseconds

    duration in milliseconds of the time window for maxNrOfRetries, negative values means no window.

    Func<Exception, Directive> localOnlyDecider

    The mapping used to translate an Exception to a Directive.

    bool loggingEnabled

    If true failures will be logged

    | Edit this page View Source

    OneForOneStrategy(int?, TimeSpan?, IDecider)

    Initializes a new instance of the OneForOneStrategy class.

    Declaration
    public OneForOneStrategy(int? maxNrOfRetries, TimeSpan? withinTimeRange, IDecider decider)
    Parameters
    Type Name Description
    int? maxNrOfRetries

    The number of times a child actor is allowed to be restarted, negative value means no limit, if the limit is exceeded the child actor is stopped.

    TimeSpan? withinTimeRange

    duration of the time window for maxNrOfRetries, System.Threading.Timeout.InfiniteTimeSpan means no window.

    IDecider decider

    The mapping used to translate an Exception to a Directive.

    | Edit this page View Source

    OneForOneStrategy(int?, TimeSpan?, Func<Exception, Directive>)

    Initializes a new instance of the OneForOneStrategy class.

    Declaration
    public OneForOneStrategy(int? maxNrOfRetries, TimeSpan? withinTimeRange, Func<Exception, Directive> localOnlyDecider)
    Parameters
    Type Name Description
    int? maxNrOfRetries

    The number of times a child actor is allowed to be restarted, negative value means no limit, if the limit is exceeded the child actor is stopped.

    TimeSpan? withinTimeRange

    duration of the time window for maxNrOfRetries, InfiniteTimeSpan means no window.

    Func<Exception, Directive> localOnlyDecider

    The mapping used to translate an Exception to a Directive.

    Properties

    | Edit this page View Source

    Decider

    The mapping from an Exception to Directive

    Declaration
    public override IDecider Decider { get; }
    Property Value
    Type Description
    IDecider
    Overrides
    SupervisorStrategy.Decider
    | Edit this page View Source

    MaxNumberOfRetries

    The number of times a child actor is allowed to be restarted, negative value means no limit, if the limit is exceeded the child actor is stopped.

    Declaration
    public int MaxNumberOfRetries { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    WithinTimeRangeMilliseconds

    The duration in milliseconds of the time window for MaxNumberOfRetries, negative values means no window.

    Declaration
    public int WithinTimeRangeMilliseconds { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    Equals(OneForOneStrategy)

    Declaration
    public bool Equals(OneForOneStrategy other)
    Parameters
    Type Name Description
    OneForOneStrategy other
    Returns
    Type Description
    bool
    | Edit this page View Source

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)
    | Edit this page View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()
    | Edit this page View Source

    Handle(IActorRef, Exception)

    Determines which Directive this strategy uses to handle exception that occur in the child actor.

    Declaration
    protected override Directive Handle(IActorRef child, Exception exception)
    Parameters
    Type Name Description
    IActorRef child

    The child actor where the exception occurred.

    Exception exception

    The exception that was thrown.

    Returns
    Type Description
    Directive

    The directive used to handle the exception.

    Overrides
    SupervisorStrategy.Handle(IActorRef, Exception)
    | Edit this page View Source

    HandleChildTerminated(IActorContext, IActorRef, IEnumerable<IInternalActorRef>)

    TBD

    Declaration
    public override void HandleChildTerminated(IActorContext actorContext, IActorRef child, IEnumerable<IInternalActorRef> children)
    Parameters
    Type Name Description
    IActorContext actorContext

    TBD

    IActorRef child

    TBD

    IEnumerable<IInternalActorRef> children

    TBD

    Overrides
    SupervisorStrategy.HandleChildTerminated(IActorContext, IActorRef, IEnumerable<IInternalActorRef>)
    | Edit this page View Source

    ProcessFailure(IActorContext, bool, IActorRef, Exception, ChildRestartStats, IReadOnlyCollection<ChildRestartStats>)

    TBD

    Declaration
    public override void ProcessFailure(IActorContext context, bool restart, IActorRef child, Exception cause, ChildRestartStats stats, IReadOnlyCollection<ChildRestartStats> children)
    Parameters
    Type Name Description
    IActorContext context

    TBD

    bool restart

    TBD

    IActorRef child

    TBD

    Exception cause

    TBD

    ChildRestartStats stats

    TBD

    IReadOnlyCollection<ChildRestartStats> children

    TBD

    Overrides
    SupervisorStrategy.ProcessFailure(IActorContext, bool, IActorRef, Exception, ChildRestartStats, IReadOnlyCollection<ChildRestartStats>)
    | Edit this page View Source

    ToSurrogate(ActorSystem)

    Creates a surrogate representation of the current OneForOneStrategy.

    Declaration
    public override ISurrogate ToSurrogate(ActorSystem system)
    Parameters
    Type Name Description
    ActorSystem system

    The actor system that owns this router.

    Returns
    Type Description
    ISurrogate

    The surrogate representation of the current OneForOneStrategy.

    Overrides
    SupervisorStrategy.ToSurrogate(ActorSystem)
    Exceptions
    Type Condition
    NotSupportedException

    This exception is thrown if the Decider is of type LocalOnlyDecider.

    | Edit this page View Source

    WithMaxNrOfRetries(int)

    Declaration
    public OneForOneStrategy WithMaxNrOfRetries(int maxNrOfRetries)
    Parameters
    Type Name Description
    int maxNrOfRetries
    Returns
    Type Description
    OneForOneStrategy

    Implements

    ISurrogated
    IEquatable<T>

    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