Table of Contents

Interface IRetryStrategy

Namespace
Kampute.HttpClient.Interfaces
Assembly
Kampute.HttpClient.dll

Defines a strategy for calculating the delay duration between retry attempts based on elapsed time and the number of attempts already made.

public interface IRetryStrategy
Extension Methods

Methods

TryGetRetryDelay(TimeSpan, uint, out TimeSpan)

Calculates the delay duration for the next retry attempt and indicates whether a retry should be attempted.

bool TryGetRetryDelay(TimeSpan elapsed, uint attempts, out TimeSpan delay)

Parameters

elapsed TimeSpan

The total time elapsed since the start of retry attempts.

attempts uint

The count of retry attempts made so far.

delay TimeSpan

When this method returns, contains the calculated delay duration for the next retry attempt, if a retry is advisable. This parameter is passed uninitialized.

Returns

bool

true if a retry attempt is advisable and should be made after the calculated delay; false otherwise, indicating no further retry attempts should be made.