Class SuspendableExecutionStrategy
A base class for IExecutionStrategy implementations that should be possible to suspend.
Inherited Members
Namespace: IRM.TransientFaultHandling
Assembly: IRM.dll
Syntax
public abstract class SuspendableExecutionStrategy : IExecutionStrategy
Properties
RetriesOnFailure
Indicates whether this IExecutionStrategy might retry the execution after a failure.
Declaration
public virtual bool RetriesOnFailure { get; }
Property Value
Boolean
|
Implements
Suspended
Indicates whether the strategy is suspended. The strategy is typically suspending while executing to avoid recursive execution from nested operations.
Declaration
protected static bool Suspended { get; set; }
Property Value
Boolean
|
Methods
Execute<TResult>(Func<TResult>)
Executes the specified operation and returns the result.
Declaration
public abstract TResult Execute<TResult>(Func<TResult> operation)
Parameters
System.Func<TResult>
operation
A delegate representing an executable operation that returns the result of type |
Returns
TResult
The result from the operation. |
Type Parameters
TResult
The return type of |
Implements
ExecuteAsync<TResult>(Func<CancellationToken, Task<TResult>>, CancellationToken)
Executes the specified asynchronous operation and returns the result.
Declaration
public abstract Task<TResult> ExecuteAsync<TResult>(Func<CancellationToken, Task<TResult>> operation, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<TResult>>
operation
A function that returns a started task of type |
System.Threading.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
System.Threading.Tasks.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 System.Threading.Tasks.Task<TResult> returned by |