NoneStrategy Class

Namespace
Kampute.HttpClient.RetryManagement.Strategies
Assembly
  • Kampute.HttpClient.dll

Definition

A retry strategy that always indicates no retry should be attempted.
public sealed class NoneStrategy : IRetryStrategy
Inheritance
Implements

Properties

Instance

Gets the singleton instance of the NoneStrategy class.
public static NoneStrategy Instance { get; }

Property Value

NoneStrategy
The singleton instance of the NoneStrategy class.

Methods

TryGetRetryDelay(TimeSpan, uint, out TimeSpan)

Always returns false to indicate that no further retry attempts should be made, setting the delay to its default value.
public bool TryGetRetryDelay(TimeSpan elapsed, uint attempts, out TimeSpan delay)

Parameters

elapsed TimeSpan
The total time elapsed since the start of retry attempts. This parameter is ignored in this implementation.
attempts uint
The number of retry attempts made so far. This parameter is ignored in this implementation.
delay TimeSpan
When this method returns, contains the default value for TimeSpan, indicating no delay. This parameter is passed uninitialized.

Returns

bool
Always returns false, indicating that no further retry attempts should be made.

Extension Methods

ToBackoffStrategy(this IRetryStrategy)Converts an IRetryStrategy into a BackoffStrategy, creating a factory capable of producing schedulers based on the provided strategy.
ToScheduler(this IRetryStrategy)Converts an IRetryStrategy into a RetryScheduler, creating a scheduler instance based on the provided strategy.
WithJitter(this IRetryStrategy, double)Enhances a retry strategy with jitter to add randomness to the retry delay.
WithMaxAttempts(this IRetryStrategy, uint)Enhances a retry strategy with a maximum number of retry attempts.
WithTimeout(this IRetryStrategy, TimeSpan)Enhances a retry strategy with a timeout, limiting the total duration allowed for retry attempts.