Documentation ¶
Overview ¶
Package util contains the redialer.
Index ¶
Constants ¶
View Source
const ( Unconfigured redialerState = iota Redialing Stopped )
Variables ¶
This section is empty.
Functions ¶
func SwapTimeouts ¶
For testing: change the default timeouts with the provided ones, returning the defaults (the idea being you reset them on test teardown).
Types ¶
type AutoRedialer ¶
type AutoRedialer interface { Redial() uint32 // Redial keeps on calling Dial until it stops returning an error. Stop() // Stop shuts down the given AutoRedialer, if it is still retrying. }
An AutoRedialer's Redial() method retries its dialer's Dial() method until it stops returning an error. It does exponential backoff (optionally jittered).
func NewAutoRedialer ¶
func NewAutoRedialer(dialer Dialer) AutoRedialer
Returns a stoppable AutoRedialer using the provided Dialer. If the Dialer is also a Jitterer, the backoff will be jittered.
Click to show internal directories.
Click to hide internal directories.