public class ExponentialBackOff : object, IBackOff
Implementation of IBackOff that increases the back-off period for each retry attempt using a
randomization function that grows exponentially. In addition, it also adds a randomize number of milliseconds
for each attempt.
Gets the delta time span used to generate a random milliseconds to add to the next back-off.
If the value is then the generated back-off will be exactly 1, 2, 4,
8, 16, etc. seconds. A valid value is between zero and one second. The default value is 250ms, which means
that the generated back-off will be [0.75-1.25]sec, [1.75-2.25]sec, [3.75-4.25]sec, and so on.
Property Value
Type
Description
TimeSpan
MaxNumOfRetries
public int MaxNumOfRetries { get; }
Gets the maximum number of retries. Default value is 10.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["The `ExponentialBackOff` class implements the `IBackOff` interface, providing a mechanism to increase the wait time between retry attempts using an exponential function and randomization."],["This class offers two constructors: a default constructor and one that allows customization of the `deltaBackOff` time span and the `maximumNumOfRetries`, which defaults to 10."],["The `DeltaBackOff` property defines the time span used to generate a random number of milliseconds to add to the next back-off period, with a default value of 250ms, offering a range of 0 to 1 seconds."],["The `MaxNumOfRetries` property specifies the maximum number of retries allowed before stopping, with a default value of 10 retries, and can be customized through one of the constructors."],["The `GetNextBackOff` method calculates the time to wait before the next retry, based on the current retry count, and returns a `TimeSpan`, or `TimeSpan.Zero` if the maximum retry limit has been reached."]]],[]]