Interface IRetryPolicy
A retry policy that can be used for synchronous and asynchronous delegates
Namespace: LemonEdge.DataAccess.Core.Abstractions.RetryPolicies
Assembly: LemonEdge.DataAccess.Core.Abstractions.dll
Syntax
public interface IRetryPolicy
Methods
Execute(Action)
Executes the provided operation synchronously
Declaration
void Execute(Action operation)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | operation | An action that should be retried on failure |
Execute(Func<Task>, CancellationToken)
Executes the provided operation asynchronously and returns a Task
Declaration
Task Execute(Func<Task> operation, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task> | operation | A func that should be retried on failure |
| CancellationToken | token | The cancellation token |
Returns
| Type | Description |
|---|---|
| Task |
Execute<TResult>(Func<Task<TResult>>, CancellationToken)
Executes the provided operation asynchronously and returns a Task{T}
Declaration
Task<TResult> Execute<TResult>(Func<Task<TResult>> operation, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task<TResult>> | operation | A func that should be retried on failure |
| CancellationToken | token | The cancellation token |
Returns
| Type | Description |
|---|---|
| Task<TResult> |
Type Parameters
| Name | Description |
|---|---|
| TResult |
Execute<TResult>(Func<TResult>)
Executes the provided operation synchronously and returns a TResult
Declaration
TResult Execute<TResult>(Func<TResult> operation)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<TResult> | operation | A func that should be retried on failure |
Returns
| Type | Description |
|---|---|
| TResult |
Type Parameters
| Name | Description |
|---|---|
| TResult |