Share via


DefaultExecutionStrategy.ExecuteAsync Method

Definition

Overloads

ExecuteAsync(Func<Task>, CancellationToken)

Executes the specified asynchronous operation once, without retrying on failure.

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

Executes the specified asynchronous operation once, without retrying on failure.

ExecuteAsync(Func<Task>, CancellationToken)

Executes the specified asynchronous operation once, without retrying on failure.

public System.Threading.Tasks.Task ExecuteAsync (Func<System.Threading.Tasks.Task> operation, System.Threading.CancellationToken cancellationToken);
abstract member ExecuteAsync : Func<System.Threading.Tasks.Task> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.ExecuteAsync : Func<System.Threading.Tasks.Task> * System.Threading.CancellationToken -> System.Threading.Tasks.Task

Parameters

operation
Func<Task>

A function that returns a started task.

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

A task that will run to completion if the original task completes successfully.

Implements

Applies to

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

Executes the specified asynchronous operation once, without retrying on failure.

public System.Threading.Tasks.Task<TResult> ExecuteAsync<TResult> (Func<System.Threading.Tasks.Task<TResult>> operation, System.Threading.CancellationToken cancellationToken);
abstract member ExecuteAsync : Func<System.Threading.Tasks.Task<'Result>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
override this.ExecuteAsync : Func<System.Threading.Tasks.Task<'Result>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>

Type Parameters

TResult

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

Parameters

operation
Func<Task<TResult>>

A function that returns a started task.

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.

Implements

Applies to