package
module
Version:
v0.0.0-...-7d0f7d2
Opens a new window with list of versions in this module.
Published: Jan 7, 2019
License: BSD-3-Clause
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 2
Opens a new window with list of known importers.
README
¶
go-backoff
A Go package for backoff functions.
It provides implementation of the following algorithms:
- Power-of-2 exponential backoff
- Base delay times power-of-2 exponential backoff
- Exponential backoff with half jitter
- Exponential backoff with full jitter
Backoff is an important part of rate limiting. This AWS blog post demonstrates the benefits of adding jitter to backoff behavior: https://www.awsarchitectureblog.com/2015/03/backoff.html
Online GoDoc
https://godoc.org/github.com/momokatte/go-backoff
Documentation
¶
Package backoff provides backoff functions using various calculations.
FullJitter creates a Pow2 exponential backoff function with full jitter, using the provided minimum and maximum values.
HalfJitter creates a Pow2 exponential backoff function with half jitter, using the provided minimum and maximum values.
None is a backoff function which always returns 0.
Pow2 is a basic exponential backoff function which returns 2^x where x is the failCount.
Pow2Exp is an exponential backoff function which returns (base * 2^x) where x is the failCount.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.