Class Backoff
Builds back-off options for creating a back-off supervisor. You can pass BackoffOptions to Props.
Inherited Members
Namespace: Akka.Pattern
Assembly: Akka.dll
Syntax
public static class Backoff
Methods
| Improve this Doc View SourceOnFailure(Props, String, TimeSpan, TimeSpan, Double)
Back-off options for creating a back-off supervisor actor that expects a child actor to restart on failure.
Declaration
[Obsolete("Use the overloaded one which accepts maxNrOfRetries instead.")]
public static BackoffOptions OnFailure(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. |
Returns
Type | Description |
---|---|
BackoffOptions |
OnFailure(Props, String, TimeSpan, TimeSpan, Double, Int32)
Back-off options for creating a back-off supervisor actor that expects a child actor to restart on failure.
Declaration
public static BackoffOptions OnFailure(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. |
Int32 | 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 |
Returns
Type | Description |
---|---|
BackoffOptions |
OnStop(Props, String, TimeSpan, TimeSpan, Double)
Back-off options for creating a back-off supervisor actor that expects a child actor to stop on failure.
Declaration
[Obsolete("Use the overloaded one which accepts maxNrOfRetries instead.")]
public static BackoffOptions OnStop(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. |
Returns
Type | Description |
---|---|
BackoffOptions |
OnStop(Props, String, TimeSpan, TimeSpan, Double, Int32)
Back-off options for creating a back-off supervisor actor that expects a child actor to stop on failure.
Declaration
public static BackoffOptions OnStop(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. |
Int32 | 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 |
Returns
Type | Description |
---|---|
BackoffOptions |