Class RetryPolicyExtensions
Inherited Members
Namespace: Unity.Cloud.Common
Syntax
public static class RetryPolicyExtensionsMethods
ExecuteAsyncWithExceptionValidation(IRetryPolicy, IRetryPolicy.RetriedOperation, IRetryPolicy.ShouldRetryExceptionChecker, CancellationToken, IProgress<RetryQueuedProgress>)
An async method that can retry an operation if it hasn't succeeded ; validation checking is performed on the exception thrown by the operation.
Declaration
public static Task ExecuteAsyncWithExceptionValidation(this IRetryPolicy retryPolicy, IRetryPolicy.RetriedOperation retriedOperation, IRetryPolicy.ShouldRetryExceptionChecker shouldRetryExceptionChecker, CancellationToken cancellationToken = default(CancellationToken), IProgress<RetryQueuedProgress> progress = null)Parameters
| Type | Name | Description | 
|---|---|---|
| IRetryPolicy | retryPolicy | |
| IRetryPolicy.RetriedOperation | retriedOperation | The IRetryPolicy.RetriedOperation that needs to be performed. | 
| IRetryPolicy.ShouldRetryExceptionChecker | shouldRetryExceptionChecker | A IRetryPolicy.ShouldRetryExceptionChecker that helps determine whether the  | 
| CancellationToken | cancellationToken | Token to cancel the task execution. | 
| IProgress<RetryQueuedProgress> | progress | Provider for progress updates on queued retries. | 
Returns
| Type | Description | 
|---|---|
| Task | The result of the  | 
Exceptions
| Type | Condition | 
|---|---|
| RetryExecutionFailedException | When  | 
| TimeoutException | When the retry policy expires. | 
| OperationCanceledException | When the  | 
| InvalidArgumentException | 
 | 
ExecuteAsyncWithExceptionValidation<T>(IRetryPolicy, IRetryPolicy.RetriedOperation<T>, IRetryPolicy.ShouldRetryExceptionChecker, CancellationToken, IProgress<RetryQueuedProgress>)
An async method that can retry an operation if it hasn't succeeded ; validation checking is performed on the exception thrown by the operation.
Declaration
public static Task<T> ExecuteAsyncWithExceptionValidation<T>(this IRetryPolicy retryPolicy, IRetryPolicy.RetriedOperation<T> retriedOperation, IRetryPolicy.ShouldRetryExceptionChecker shouldRetryExceptionChecker, CancellationToken cancellationToken = default(CancellationToken), IProgress<RetryQueuedProgress> progress = null)Parameters
| Type | Name | Description | 
|---|---|---|
| IRetryPolicy | retryPolicy | |
| IRetryPolicy.RetriedOperation<T> | retriedOperation | The IRetryPolicy.RetriedOperation<T> that needs to be performed. | 
| IRetryPolicy.ShouldRetryExceptionChecker | shouldRetryExceptionChecker | A IRetryPolicy.ShouldRetryExceptionChecker that helps determine whether the  | 
| CancellationToken | cancellationToken | Token to cancel the task execution. | 
| IProgress<RetryQueuedProgress> | progress | Provider for progress updates on queued retries. | 
Returns
| Type | Description | 
|---|---|
| Task<T> | The result of the  | 
Type Parameters
| Name | Description | 
|---|---|
| T | 
Exceptions
| Type | Condition | 
|---|---|
| RetryExecutionFailedException | When  | 
| TimeoutException | When the retry policy expires. | 
| OperationCanceledException | When the  | 
ExecuteAsyncWithResultValidation<T>(IRetryPolicy, IRetryPolicy.RetriedOperation<T>, IRetryPolicy.ShouldRetryResultChecker<T>, CancellationToken, IProgress<RetryQueuedProgress>)
An async method that can retry an operation if it hasn't succeeded ; validation checking is performed on the result of the operation.
Declaration
public static Task<T> ExecuteAsyncWithResultValidation<T>(this IRetryPolicy retryPolicy, IRetryPolicy.RetriedOperation<T> retriedOperation, IRetryPolicy.ShouldRetryResultChecker<T> shouldRetryResultChecker, CancellationToken cancellationToken = default(CancellationToken), IProgress<RetryQueuedProgress> progress = null)Parameters
| Type | Name | Description | 
|---|---|---|
| IRetryPolicy | retryPolicy | |
| IRetryPolicy.RetriedOperation<T> | retriedOperation | The IRetryPolicy.RetriedOperation<T> that needs to be performed. | 
| IRetryPolicy.ShouldRetryResultChecker<T> | shouldRetryResultChecker | A IRetryPolicy.ShouldRetryResultChecker<T> that helps determine whether the  | 
| CancellationToken | cancellationToken | Token to cancel the task execution. | 
| IProgress<RetryQueuedProgress> | progress | Provider for progress updates on queued retries. | 
Returns
| Type | Description | 
|---|---|
| Task<T> | The result of the  | 
Type Parameters
| Name | Description | 
|---|---|
| T | 
Exceptions
| Type | Condition | 
|---|---|
| RetryExecutionFailedException | When  | 
| TimeoutException | When the retry policy expires. | 
| OperationCanceledException | When the  |