Documentation
¶
Overview ¶
Package retry implements back off retry strategy for reconnect web socket connection.
Package retry implements back off retry strategy for reconnect web socket connection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RepeatableExponentialRetryer ¶
type RepeatableExponentialRetryer struct {
CallableFunc func() error
GeometricRatio float64
InitialDelayInMilli int
MaxDelayInMilli int
MaxAttempts int
}
RepeatableExponentialRetryer implements exponential backoff retry strategy.
func (*RepeatableExponentialRetryer) Call ¶
func (r *RepeatableExponentialRetryer) Call() error
Call calls the operation and does exponential retry if error happens.
func (*RepeatableExponentialRetryer) NextSleepTime ¶
func (r *RepeatableExponentialRetryer) NextSleepTime(attempt int) time.Duration
NextSleepTime calculates the next delay of retry.
Click to show internal directories.
Click to hide internal directories.