Class ExponentialBackOffRetryPolicy
Implements an exponential back-off retry policy for handling transient errors.
Implements
Inherited Members
Namespace: UnityEngine.Purchasing
Assembly: Unity.Purchasing.dll
Syntax
public class ExponentialBackOffRetryPolicy : IRetryPolicy
Constructors
ExponentialBackOffRetryPolicy(int, int, float)
Initializes a new instance of ExponentialBackOffRetryPolicy.
Declaration
public ExponentialBackOffRetryPolicy(int baseRetryDelay = 1000, int maxRetryDelay = 30000, float exponentialFactor = 2)
Parameters
Type | Name | Description |
---|---|---|
int | baseRetryDelay | The base delay in milliseconds before the first retry. |
int | maxRetryDelay | The maximum delay in milliseconds before retrying. |
float | exponentialFactor | The exponential factor by which the retry delay increases after each attempt. |
Methods
ShouldRetry(IRetryPolicyInformation)
Determines whether the policy should retry the operation based on the provided information.
Declaration
public virtual Task<bool> ShouldRetry(IRetryPolicyInformation info)
Parameters
Type | Name | Description |
---|---|---|
IRetryPolicyInformation | info | The information about the retry attempt, including the number of attempts made. |
Returns
Type | Description |
---|---|
Task<bool> | True if the operation should be retried; otherwise, false. |