Table of Contents

Interface IRetryPolicy

Namespace
LinqToDB.Data.RetryPolicy
Assembly
linq2db.dll
public interface IRetryPolicy
Extension Methods

Methods

Execute(Action)

void Execute(Action operation)

Parameters

operation Action

ExecuteAsync(Func<CancellationToken, Task>, CancellationToken)

Task ExecuteAsync(Func<CancellationToken, Task> operation, CancellationToken cancellationToken = default)

Parameters

operation Func<CancellationToken, Task>
cancellationToken CancellationToken

Returns

Task

ExecuteAsync<TResult>(Func<CancellationToken, Task<TResult>>, CancellationToken)

Executes the specified asynchronous operation and returns the result.

Task<TResult> ExecuteAsync<TResult>(Func<CancellationToken, Task<TResult>> operation, CancellationToken cancellationToken = default)

Parameters

operation Func<CancellationToken, Task<TResult>>

A function that returns a started task of type TResult.

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

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

TResult

The result type of the Task<TResult> returned by operation.

Execute<TResult>(Func<TResult>)

Executes the specified operation and returns the result.

TResult Execute<TResult>(Func<TResult> operation)

Parameters

operation Func<TResult>

A delegate representing an executable operation that returns the result of type TResult.

Returns

TResult

The result from the operation.

Type Parameters

TResult

The return type of operation.