Interface IRetryPolicy
Namespace: LinqToDB.Data.RetryPolicy
Assembly: linq2db.dll
Syntax
public interface IRetryPolicy
Methods
| Improve this Doc View SourceExecute(Action)
Declaration
void Execute(Action operation)
Parameters
Type | Name | Description |
---|---|---|
Action | operation |
Execute<TResult>(Func<TResult>)
Executes the specified operation and returns the result.
Declaration
TResult Execute<TResult>(Func<TResult> operation)
Parameters
Type | Name | Description |
---|---|---|
Func<TResult> | operation | A delegate representing an executable operation that returns the result of type |
Returns
Type | Description |
---|---|
TResult | The result from the operation. |
Type Parameters
Name | Description |
---|---|
TResult | The return type of |
ExecuteAsync(Func<CancellationToken, Task>, CancellationToken)
Declaration
Task ExecuteAsync(Func<CancellationToken, Task> operation, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Func<CancellationToken, Task> | operation | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
ExecuteAsync<TResult>(Func<CancellationToken, Task<TResult>>, CancellationToken)
Executes the specified asynchronous operation and returns the result.
Declaration
Task<TResult> ExecuteAsync<TResult>(Func<CancellationToken, Task<TResult>> operation, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Func<CancellationToken, Task<TResult>> | operation | A function that returns a started task of type |
CancellationToken | cancellationToken | A cancellation token used to cancel the retry operation, but not operations that are already in flight or that already completed successfully. |
Returns
Type | Description |
---|---|
Task<TResult> | A task that will run to completion if the original task completes successfully (either the first time or after retrying transient failures). If the task fails with a non-transient error or the retry limit is reached, the returned task will become faulted and the exception must be observed. |
Type Parameters
Name | Description |
---|---|
TResult | The result type of the |