Table of Contents

Class SimpleRetryHandler

Namespace
Phetch.Core
Assembly
Phetch.Core.dll

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).

Example:
RetryHandler = RetryHandler.Simple(2);

Properties

MaxRetries

The maximum number of times to retry before giving up.

public int MaxRetries { get; }

Property Value

int

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