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."],[[["\u003cp\u003eThe \u003ccode\u003eExponentialBackOff\u003c/code\u003e class implements the \u003ccode\u003eIBackOff\u003c/code\u003e interface, providing a mechanism to increase the wait time between retry attempts using an exponential function and randomization.\u003c/p\u003e\n"],["\u003cp\u003eThis class offers two constructors: a default constructor and one that allows customization of the \u003ccode\u003edeltaBackOff\u003c/code\u003e time span and the \u003ccode\u003emaximumNumOfRetries\u003c/code\u003e, which defaults to 10.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDeltaBackOff\u003c/code\u003e 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.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMaxNumOfRetries\u003c/code\u003e 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.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGetNextBackOff\u003c/code\u003e method calculates the time to wait before the next retry, based on the current retry count, and returns a \u003ccode\u003eTimeSpan\u003c/code\u003e, or \u003ccode\u003eTimeSpan.Zero\u003c/code\u003e if the maximum retry limit has been reached.\u003c/p\u003e\n"]]],[],null,[]]