ExecutionStrategyExtensions ExecutionStrategyExtensions Class

Definition

Extension methods for IExecutionStrategy

public static class ExecutionStrategyExtensions
Public Module ExecutionStrategyExtensions
Inheritance
System.ObjectSystem.Object
ExecutionStrategyExtensionsExecutionStrategyExtensions

Methods

Equals(Object) Equals(Object)

Inherited from System.Object

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

Execute(IExecutionStrategy, Action) Execute(IExecutionStrategy, Action)

Executes the specified operation.

public static void Execute(this IExecutionStrategy strategy, Action operation)
<ExtensionAttribute>
Public Shared Sub Execute(strategy As IExecutionStrategy, operation As Action)
Parameters
strategy
IExecutionStrategy IExecutionStrategy

The strategy that will be used for the execution.

operation
System.Action System.Action

A delegate representing an executable operation that doesn't return any results.

Execute(IExecutionStrategy, Func) Execute(Of TResult)(IExecutionStrategy, Func(Of TResult))

Executes the specified operation and returns the result.

public static TResult Execute<TResult>(this IExecutionStrategy strategy, Func<TResult> operation)
<ExtensionAttribute>
Public Shared Function Execute(Of TResult)(strategy As IExecutionStrategy, operation As Func(Of TResult)) As TResult
Type Parameters
TResult

The return type of operation.

Parameters
strategy
IExecutionStrategy IExecutionStrategy

The strategy that will be used for the execution.

operation
System.Func<TResult> System.Func(Of TResult)

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

Returns
TResult TResult

The result from the operation.

Execute(IExecutionStrategy, Action, TState) Execute(Of TState)(IExecutionStrategy, Action(Of TState), TState)

Executes the specified operation.

public static void Execute<TState>(this IExecutionStrategy strategy, Action<TState> operation, TState state)
<ExtensionAttribute>
Public Shared Sub Execute(Of TState)(strategy As IExecutionStrategy, operation As Action(Of TState), state As TState)
Type Parameters
TState

The type of the state.

Parameters
strategy
IExecutionStrategy IExecutionStrategy

The strategy that will be used for the execution.

operation
System.Action<TState> System.Action(Of TState)

A delegate representing an executable operation that doesn't return any results.

state
TState TState

The state that will be passed to the operation.

ExecuteAsync(IExecutionStrategy, Func, CancellationToken) ExecuteAsync(IExecutionStrategy, Func(Of CancellationToken, Task), CancellationToken)

Executes the specified asynchronous operation.

public static Task ExecuteAsync(this IExecutionStrategy strategy, Func<CancellationToken, Task> operation, CancellationToken cancellationToken)
<ExtensionAttribute>
Public Shared Function ExecuteAsync(strategy As IExecutionStrategy, operation As Func(Of CancellationToken, Task), cancellationToken As CancellationToken) As Task
Parameters
strategy
IExecutionStrategy IExecutionStrategy

The strategy that will be used for the execution.

operation
System.Func<System.Threading.CancellationToken, System.Threading.Tasks.Task> System.Func(Of System.Threading.CancellationToken, System.Threading.Tasks.Task)

A function that returns a started task.

cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken

A cancellation token used to cancel the retry operation, but not operations that are already in flight or that already completed successfully.

Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

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.

ExecuteAsync(IExecutionStrategy, Func) ExecuteAsync(IExecutionStrategy, Func(Of Task))

Executes the specified asynchronous operation.

public static Task ExecuteAsync(this IExecutionStrategy strategy, Func<Task> operation)
<ExtensionAttribute>
Public Shared Function ExecuteAsync(strategy As IExecutionStrategy, operation As Func(Of Task)) As Task
Parameters
strategy
IExecutionStrategy IExecutionStrategy

The strategy that will be used for the execution.

operation
System.Func<System.Threading.Tasks.Task> System.Func(Of System.Threading.Tasks.Task)

A function that returns a started task.

Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

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.

ExecuteAsync(IExecutionStrategy, Func>, CancellationToken) ExecuteAsync(Of TResult)(IExecutionStrategy, Func(Of CancellationToken, Task(Of TResult)), CancellationToken)

Executes the specified asynchronous operation and returns the result.

public static Task<TResult> ExecuteAsync<TResult>(this IExecutionStrategy strategy, Func<CancellationToken, Task<TResult>> operation, CancellationToken cancellationToken)
<ExtensionAttribute>
Public Shared Function ExecuteAsync(Of TResult)(strategy As IExecutionStrategy, operation As Func(Of CancellationToken, Task(Of TResult)), cancellationToken As CancellationToken) As Task(Of TResult)
Type Parameters
TResult

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

Parameters
strategy
IExecutionStrategy IExecutionStrategy

The strategy that will be used for the execution.

operation
System.Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<TResult>> System.Func(Of System.Threading.CancellationToken, System.Threading.Tasks.Task(Of TResult))

A function that returns a started task of type TResult.

cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken

A cancellation token used to cancel the retry operation, but not operations that are already in flight or that already completed successfully.

Returns
System.Threading.Tasks.Task<TResult> System.Threading.Tasks.Task(Of 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.

ExecuteAsync(IExecutionStrategy, Func<>>) ExecuteAsync(Of TResult)(IExecutionStrategy, Func(Of Task(Of TResult)))

Executes the specified asynchronous operation and returns the result.

public static Task<TResult> ExecuteAsync<TResult>(this IExecutionStrategy strategy, Func<Task<TResult>> operation)
<ExtensionAttribute>
Public Shared Function ExecuteAsync(Of TResult)(strategy As IExecutionStrategy, operation As Func(Of Task(Of TResult))) As Task(Of TResult)
Type Parameters
TResult

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

Parameters
strategy
IExecutionStrategy IExecutionStrategy

The strategy that will be used for the execution.

operation
System.Func<System.Threading.Tasks.Task<TResult>> System.Func(Of System.Threading.Tasks.Task(Of TResult))

A function that returns a started task of type TResult.

Returns
System.Threading.Tasks.Task<TResult> System.Threading.Tasks.Task(Of 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.

ExecuteAsync(IExecutionStrategy, Func>, TState) ExecuteAsync(Of TState, TResult)(IExecutionStrategy, Func(Of TState, Task(Of TResult)), TState)

Executes the specified asynchronous operation and returns the result.

public static Task<TResult> ExecuteAsync<TState, TResult>(this IExecutionStrategy strategy, Func<TState, Task<TResult>> operation, TState state)
<ExtensionAttribute>
Public Shared Function ExecuteAsync(Of TState, TResult)(strategy As IExecutionStrategy, operation As Func(Of TState, Task(Of TResult)), state As TState) As Task(Of TResult)
Type Parameters
TState

The type of the state.

TResult

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

Parameters
strategy
IExecutionStrategy IExecutionStrategy

The strategy that will be used for the execution.

operation
System.Func<TState, System.Threading.Tasks.Task<TResult>> System.Func(Of TState, System.Threading.Tasks.Task(Of TResult))

A function that returns a started task of type TResult.

state
TState TState

The state that will be passed to the operation.

Returns
System.Threading.Tasks.Task<TResult> System.Threading.Tasks.Task(Of 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.

ExecuteAsync(IExecutionStrategy, Func, TState, CancellationToken) ExecuteAsync(Of TState)(IExecutionStrategy, Func(Of TState, CancellationToken, Task), TState, CancellationToken)

Executes the specified asynchronous operation.

public static Task ExecuteAsync<TState>(this IExecutionStrategy strategy, Func<TState, CancellationToken, Task> operation, TState state, CancellationToken cancellationToken)
<ExtensionAttribute>
Public Shared Function ExecuteAsync(Of TState)(strategy As IExecutionStrategy, operation As Func(Of TState, CancellationToken, Task), state As TState, cancellationToken As CancellationToken) As Task
Type Parameters
TState

The type of the state.

Parameters
strategy
IExecutionStrategy IExecutionStrategy

The strategy that will be used for the execution.

operation
System.Func<TState, System.Threading.CancellationToken, System.Threading.Tasks.Task> System.Func(Of TState, System.Threading.CancellationToken, System.Threading.Tasks.Task)

A function that returns a started task.

state
TState TState

The state that will be passed to the operation.

cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken

A cancellation token used to cancel the retry operation, but not operations that are already in flight or that already completed successfully.

Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

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.

ExecuteAsync(IExecutionStrategy, Func, TState) ExecuteAsync(Of TState)(IExecutionStrategy, Func(Of TState, Task), TState)

Executes the specified asynchronous operation.

public static Task ExecuteAsync<TState>(this IExecutionStrategy strategy, Func<TState, Task> operation, TState state)
<ExtensionAttribute>
Public Shared Function ExecuteAsync(Of TState)(strategy As IExecutionStrategy, operation As Func(Of TState, Task), state As TState) As Task
Type Parameters
TState

The type of the state.

Parameters
strategy
IExecutionStrategy IExecutionStrategy

The strategy that will be used for the execution.

operation
System.Func<TState, System.Threading.Tasks.Task> System.Func(Of TState, System.Threading.Tasks.Task)

A function that returns a started task.

state
TState TState

The state that will be passed to the operation.

Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

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.

GetHashCode() GetHashCode()

Inherited from System.Object

GetType() GetType()

Inherited from System.Object

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

ToString() ToString()

Inherited from System.Object