Class AllForOneStrategy
This class represents a fault handling strategy that applies a Directive to all child actors when one child fails.
Inherited Members
Namespace: Akka.Actor
Assembly: Akka.dll
Syntax
public class AllForOneStrategy : SupervisorStrategy, ISurrogated, IEquatable<AllForOneStrategy>
Constructors
| Improve this Doc View SourceAllForOneStrategy()
Initializes a new instance of the AllForOneStrategy class.
Declaration
protected AllForOneStrategy()
AllForOneStrategy(IDecider)
Initializes a new instance of the AllForOneStrategy class.
Declaration
public AllForOneStrategy(IDecider decider)
Parameters
Type | Name | Description |
---|---|---|
IDecider | decider |
AllForOneStrategy(Func<Exception, Directive>)
Initializes a new instance of the AllForOneStrategy class.
Declaration
public AllForOneStrategy(Func<Exception, Directive> localOnlyDecider)
Parameters
Type | Name | Description |
---|---|---|
Func<Exception, Directive> | localOnlyDecider |
AllForOneStrategy(Int32, Int32, IDecider, Boolean)
Initializes a new instance of the AllForOneStrategy class.
Declaration
public AllForOneStrategy(int maxNrOfRetries, int withinTimeMilliseconds, IDecider decider, bool loggingEnabled = true)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Int32 | withinTimeMilliseconds | duration in milliseconds of the time window for |
IDecider | decider | |
Boolean | loggingEnabled | If |
AllForOneStrategy(Int32, Int32, Func<Exception, Directive>, Boolean)
Initializes a new instance of the AllForOneStrategy class.
Declaration
public AllForOneStrategy(int maxNrOfRetries, int withinTimeMilliseconds, Func<Exception, Directive> localOnlyDecider, bool loggingEnabled = true)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Int32 | withinTimeMilliseconds | duration in milliseconds of the time window for |
Func<Exception, Directive> | localOnlyDecider | |
Boolean | loggingEnabled | If |
AllForOneStrategy(Nullable<Int32>, Nullable<TimeSpan>, IDecider)
Initializes a new instance of the AllForOneStrategy class.
Declaration
public AllForOneStrategy(int? maxNrOfRetries, TimeSpan? withinTimeRange, IDecider decider)
Parameters
Type | Name | Description |
---|---|---|
Nullable<Int32> | maxNrOfRetries | The number of times a child actor is allowed to be restarted, negative value and null means no limit, if the limit is exceeded the child actor is stopped. |
Nullable<TimeSpan> | withinTimeRange | duration of the time window for maxNrOfRetries, InfiniteTimeSpan means no window. |
IDecider | decider |
AllForOneStrategy(Nullable<Int32>, Nullable<TimeSpan>, Func<Exception, Directive>)
Initializes a new instance of the AllForOneStrategy class.
Declaration
public AllForOneStrategy(int? maxNrOfRetries, TimeSpan? withinTimeRange, Func<Exception, Directive> localOnlyDecider)
Parameters
Type | Name | Description |
---|---|---|
Nullable<Int32> | maxNrOfRetries | The number of times a child actor is allowed to be restarted, negative value and null means no limit, if the limit is exceeded the child actor is stopped. |
Nullable<TimeSpan> | withinTimeRange | duration of the time window for maxNrOfRetries, InfiniteTimeSpan means no window. |
Func<Exception, Directive> | localOnlyDecider |
Properties
| Improve this Doc View SourceDecider
Declaration
public override IDecider Decider { get; }
Property Value
Type | Description |
---|---|
IDecider |
Overrides
| Improve this Doc View SourceMaxNumberOfRetries
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 |
---|---|
Int32 |
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 |
---|---|
Int32 |
Methods
| Improve this Doc View SourceEquals(AllForOneStrategy)
Declaration
public bool Equals(AllForOneStrategy other)
Parameters
Type | Name | Description |
---|---|---|
AllForOneStrategy | other |
Returns
Type | Description |
---|---|
Boolean |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
| Improve this Doc View SourceGetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
| Improve this Doc View SourceHandle(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
| Improve this Doc View SourceHandleChildTerminated(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<Akka.Actor.IInternalActorRef> | children | TBD |
Overrides
| Improve this Doc View SourceProcessFailure(IActorContext, Boolean, 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 |
Boolean | restart | TBD |
IActorRef | child | TBD |
Exception | cause | TBD |
ChildRestartStats | stats | TBD |
IReadOnlyCollection<ChildRestartStats> | children | TBD |
Overrides
| Improve this Doc View SourceToSurrogate(ActorSystem)
Creates a surrogate representation of the current AllForOneStrategy.
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 AllForOneStrategy. |