Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Simple mode - time increases by sleep + jitter*attempt. Simple mode = 0 // Linear mode - time increases by sleep*attempt + jitter. Linear mode = 1 // Exponential mode - time increases by sleep*2^attempt + jitter. Exponential mode = 2 // Fibonacci mode - time increases by sleep*fibonacci(attempt) + jitter. Fibonacci mode = 3 )
Variables ¶
This section is empty.
Functions ¶
func Jitter ¶
Jitter sets sleep-jitter value - if set, every attempt will await for sleep_value + jitter_value * attempt_number.
func Mode ¶ added in v1.1.0
func Mode(m mode) func(*Config)
Mode sets sleep mode - linear, exponential or simple (by default).
func Parallelism ¶
Parallelism sets max parallelism count, zero (default) - indicates no limit.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config holds configuration.
func New ¶
func New(opts ...option) (c *Config)
New creates new `Config` with given options If no options given default configuration will be applied: 1 retry in 1 second.
Click to show internal directories.
Click to hide internal directories.