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
| Edit this page 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, int)
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. |
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 |
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, int)
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. |
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 |
Returns
Type | Description |
---|---|
BackoffOptions |