Click or drag to resize
Akka.NETOneForOneStrategy Class
Class OneForOneStrategy. This class cannot be inherited. The result of this strategy is applied only to the failing child
Inheritance Hierarchy

Namespace:  Akka.Actor
Assembly:  Akka (in Akka.dll) Version: 1.2.3.42 (1.2.3.42)
Syntax
public class OneForOneStrategy : SupervisorStrategy, 
	IEquatable<OneForOneStrategy>

The OneForOneStrategy type exposes the following members.

Constructors
  NameDescription
Protected methodOneForOneStrategy
Serialization-friendly constructor
Public methodOneForOneStrategy(FuncException, Directive)
Constructor that accepts only a decider and uses reasonable defaults for the other settings
Public methodOneForOneStrategy(IDecider)
Constructor that accepts only a decider and uses reasonable defaults for the other settings
Public methodOneForOneStrategy(FuncException, Directive, Boolean)
Constructor that accepts only a decider and uses reasonable defaults for the other settings
Public methodOneForOneStrategy(NullableInt32, NullableTimeSpan, IDecider)
Applies the fault handling `Directive` (Resume, Restart, Stop) specified in the `Decider` only to the child that failed, as opposed to AllForOneStrategy that applies it to all children when one failed.
Public methodOneForOneStrategy(NullableInt32, NullableTimeSpan, FuncException, Directive)
Applies the fault handling `Directive` (Resume, Restart, Stop) specified in the `Decider` only to the child that failed, as opposed to AllForOneStrategy that applies it to all children when one failed.
Public methodOneForOneStrategy(Int32, Int32, IDecider, Boolean)
Applies the fault handling `Directive` (Resume, Restart, Stop) specified in the `Decider` only to the child that failed, as opposed to AllForOneStrategy that applies it to all children when one failed.
Public methodOneForOneStrategy(Int32, Int32, FuncException, Directive, Boolean)
Applies the fault handling `Directive` (Resume, Restart, Stop) specified in the `Decider` only to the child that failed, as opposed to AllForOneStrategy that applies it to all children when one failed.
Top
Properties
  NameDescription
Public propertyDecider
The mapping from an Exception to Directive
(Overrides SupervisorStrategyDecider.)
Protected propertyLoggingEnabled
Determines if failures are logged
(Inherited from SupervisorStrategy.)
Public propertyMaxNumberOfRetries
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.
Public propertyWithinTimeRangeMilliseconds
The duration in milliseconds of the time window for MaxNumberOfRetries, negative values means no window.
Top
Methods
  NameDescription
Public methodEquals(Object)
Determines whether the specified object is equal to the current object.
(Overrides ObjectEquals(Object).)
Public methodEquals(OneForOneStrategy)
Indicates whether the current object is equal to another object of the same type.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Overrides ObjectGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodHandle
Handles the specified child.
(Overrides SupervisorStrategyHandle(IActorRef, Exception).)
Public methodHandleChildTerminated
TBD
(Overrides SupervisorStrategyHandleChildTerminated(IActorContext, IActorRef, IEnumerableIInternalActorRef).)
Public methodHandleFailure(ActorCell, Exception, ChildRestartStats, IReadOnlyCollectionChildRestartStats) Obsolete.
TBD
(Inherited from SupervisorStrategy.)
Public methodHandleFailure(ActorCell, IActorRef, Exception, ChildRestartStats, IReadOnlyCollectionChildRestartStats)
This is the main entry point: in case of a child’s failure, this method must try to handle the failure by resuming, restarting or stopping the child (and returning `true`), or it returns `false` to escalate the failure, which will lead to this actor re-throwing the exception which caused the failure. The exception will not be wrapped. This method calls SupervisorStrategy, which will log the failure unless it is escalated. You can customize the logging by setting SupervisorStrategy to `false` and do the logging inside the `decider` or override the `LogFailure` method.
(Inherited from SupervisorStrategy.)
Protected methodLogFailure
Logs the failure.
(Inherited from SupervisorStrategy.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodProcessFailure(IActorContext, Boolean, Exception, ChildRestartStats, IReadOnlyCollectionChildRestartStats) Obsolete. (Overrides SupervisorStrategyProcessFailure(IActorContext, Boolean, Exception, ChildRestartStats, IReadOnlyCollectionChildRestartStats).)
Protected methodProcessFailure(IActorContext, Boolean, IActorRef, Exception, ChildRestartStats, IReadOnlyCollectionChildRestartStats)
TBD
(Overrides SupervisorStrategyProcessFailure(IActorContext, Boolean, IActorRef, Exception, ChildRestartStats, IReadOnlyCollectionChildRestartStats).)
Protected methodRestartChild
Restarts the child.
(Inherited from SupervisorStrategy.)
Protected methodResumeChild
Resume the previously failed child: do never apply this to a child which is not the currently failing child. Suspend/resume needs to be done in matching pairs, otherwise actors will wake up too soon or never at all.
(Inherited from SupervisorStrategy.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodToSurrogate
Creates a surrogate representation of the current OneForOneStrategy.
(Overrides SupervisorStrategyToSurrogate(ActorSystem).)
Top
Extension Methods
See Also