Table of Contents

Method Exponential

Namespace
Millrace
Assembly
Millrace.dll

Exponential(int, TimeSpan?, TimeSpan?)

A policy whose wait doubles after each failure, up to a ceiling.

public static Retry Exponential(int maxAttempts, TimeSpan? baseDelay = null, TimeSpan? maxDelay = null)

Parameters

maxAttempts int
baseDelay TimeSpan?
maxDelay TimeSpan?

Returns

Retry

Remarks

Defaults to a 5 second base and a 1 hour ceiling — quick enough to ride out a blip, slow enough that a sustained outage is not hammered. The doubling is clamped internally, so a large maxAttempts cannot overflow the computed delay.

Exceptions

ArgumentOutOfRangeException

maxAttempts is below 1, baseDelay is negative, or maxDelay is below the base — a ceiling under the floor has no reading.