Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMaxRetriesExceeded = errors.New("max number of dial retries exceeded")
ErrMaxRetriesExceeded is returned by the retrying dialer to indicate that a connection was not possible after the configured number of max attempts.
Functions ¶
This section is empty.
Types ¶
type RetryingDialer ¶
type RetryingDialer struct {
// contains filtered or unexported fields
}
RetryingDialer wraps a DialFunc with an exponential back-off retry mechanism.
func NewRetryingDialer ¶
func NewRetryingDialer(ctx context.Context, clk clock.Clock, dialFunc DialFunc, maxAttempts int) *RetryingDialer
NewRetryingDialer returns a new dialer that wraps dialFunc with a retry layer that waits between attempts using an exponential back-off algorithm. Dial attempts will be aborted if the attempts exceed maxAttempts or the provided context is cancelled.
Click to show internal directories.
Click to hide internal directories.