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
Returns
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
maxAttemptsis below 1,baseDelayis negative, ormaxDelayis below the base — a ceiling under the floor has no reading.