Google API Client Library for .NET  1.10.0
Public Member Functions | Properties | List of all members
Google.Apis.Util.ExponentialBackOff Class Reference

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. More...

Inheritance diagram for Google.Apis.Util.ExponentialBackOff:
Google.Apis.Util.IBackOff

Public Member Functions

 ExponentialBackOff ()
 Constructs a new exponential back-off with default values. More...
 
 ExponentialBackOff (TimeSpan deltaBackOff, int maximumNumOfRetries=10)
 Constructs a new exponential back-off with the given delta and maximum retries. More...
 
TimeSpan GetNextBackOff (int currentRetry)
 Gets the a time span to wait before next retry. If the current retry reached the maximum number of retries, the returned value is TimeSpan.MinValue. More...
 

Properties

TimeSpan DeltaBackOff [get]
 Gets the delta time span used to generate a random milliseconds to add to the next back-off. If the value is System.TimeSpan.Zero 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. More...
 
int MaxNumOfRetries [get]
 Gets the maximum number of retries. Default value is 10. More...
 
- Properties inherited from Google.Apis.Util.IBackOff
int MaxNumOfRetries [get]
 Gets the maximum number of retries. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

Google.Apis.Util.ExponentialBackOff.ExponentialBackOff ( )
inline

Constructs a new exponential back-off with default values.

Google.Apis.Util.ExponentialBackOff.ExponentialBackOff ( TimeSpan  deltaBackOff,
int  maximumNumOfRetries = 10 
)
inline

Constructs a new exponential back-off with the given delta and maximum retries.

Member Function Documentation

TimeSpan Google.Apis.Util.ExponentialBackOff.GetNextBackOff ( int  currentRetry)
inline

Gets the a time span to wait before next retry. If the current retry reached the maximum number of retries, the returned value is TimeSpan.MinValue.

Implements Google.Apis.Util.IBackOff.

Property Documentation

TimeSpan Google.Apis.Util.ExponentialBackOff.DeltaBackOff
get

Gets the delta time span used to generate a random milliseconds to add to the next back-off. If the value is System.TimeSpan.Zero 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.

int Google.Apis.Util.ExponentialBackOff.MaxNumOfRetries
get

Gets the maximum number of retries. Default value is 10.


The documentation for this class was generated from the following file: