Documentation ¶
Overview ¶
Package backoff is a slightly changed version of the backoff algorithm that comes with gRPC See: vendor/google.golang.org/grpc/LICENSE for the license
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultConfig = Config{ MaxDelay: 120 * time.Second, BaseDelay: 1.0 * time.Second, Factor: 1.6, Jitter: 0.2, } )
DefaultConfig is the default backoff configuration
Functions ¶
Types ¶
type Config ¶
type Config struct { // MaxDelay is the upper bound of backoff delay. MaxDelay time.Duration // BaseDelay is the amount of time to wait before retrying after the first failure. BaseDelay time.Duration // factor is applied to the backoff after each retry. Factor float64 // jitter provides a range to randomize backoff delays. Jitter float64 }
Config defines the parameters for backoff
Click to show internal directories.
Click to hide internal directories.