Class SimpleRetryHandler
A simple retry handler that retries a given number of times with no waiting between retries.
This will retry if the query function throws an exception other than OperationCanceledException.public sealed class SimpleRetryHandler : IRetryHandler
- Inheritance
-
SimpleRetryHandler
- Implements
- Inherited Members
Remarks
Construct this using Simple(int).
RetryHandler = RetryHandler.Simple(2);
Properties
MaxRetries
The maximum number of times to retry before giving up.
public int MaxRetries { get; }
Property Value
Methods
ExecuteAsync<TResult>(Func<CancellationToken, Task<TResult>>, CancellationToken)
Invokes the provided query function and optionally handles errors.
public Task<TResult> ExecuteAsync<TResult>(Func<CancellationToken, Task<TResult>> queryFn, CancellationToken ct)
Parameters
queryFn
Func<CancellationToken, Task<TResult>>ct
CancellationToken
Returns
- Task<TResult>
Type Parameters
TResult