mirror of https://github.com/jpillora/backoff.git
Merge pull request #18 from kishaningithub/patch-1
Explicitly document the default values
This commit is contained in:
commit
fab01a9d98
22
backoff.go
22
backoff.go
|
@ -16,12 +16,26 @@ import (
|
||||||
// be used concurrently.
|
// be used concurrently.
|
||||||
type Backoff struct {
|
type Backoff struct {
|
||||||
attempt uint64
|
attempt uint64
|
||||||
// Factor is the multiplying factor for each increment step
|
|
||||||
|
// Factor is the multiplying factor for each increment step.
|
||||||
|
//
|
||||||
|
// Defaults to 2.
|
||||||
Factor float64
|
Factor float64
|
||||||
// Jitter eases contention by randomizing backoff steps
|
|
||||||
|
// Jitter eases contention by randomizing backoff steps.
|
||||||
|
//
|
||||||
|
// Defaults to false.
|
||||||
Jitter bool
|
Jitter bool
|
||||||
// Min and Max are the minimum and maximum values of the counter
|
|
||||||
Min, Max time.Duration
|
// Minimum value of the counter.
|
||||||
|
//
|
||||||
|
// Defaults to 100 milliseconds.
|
||||||
|
Min time.Duration
|
||||||
|
|
||||||
|
// Maximum value of the counter.
|
||||||
|
//
|
||||||
|
// Defaults to 10 seconds.
|
||||||
|
Max time.Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
// Duration returns the duration for the current attempt before incrementing
|
// Duration returns the duration for the current attempt before incrementing
|
||||||
|
|
Loading…
Reference in New Issue