Documentation ¶
Overview ¶
Package expbackoff provides an implementation of exponential backoff, useful for preventing client retries from overloading a recovering server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpBackoff ¶
type ExpBackoff struct {
// contains filtered or unexported fields
}
ExpBackoff implements an exponential backoff algorithm with random jitter. The algorithm is identical to the one used in the guts of gRPC.
func Build ¶
func Build(rng *rand.Rand, cfg backoff.Config) ExpBackoff
Build returns an ExpBackoff that uses a custom backoff configuration.
func BuildDefault ¶
func BuildDefault() ExpBackoff
BuildDefault returns an ExpBackoff that uses the gRPC default backoff configuration.
Click to show internal directories.
Click to hide internal directories.