Documentation ¶
Overview ¶
retry implements back off retry strategy for reconnect web socket connection.
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 }
func (*RepeatableExponentialRetryer) Call ¶
func (retryer *RepeatableExponentialRetryer) Call() (err error)
Call calls the operation and does exponential retry if error happens.
func (*RepeatableExponentialRetryer) NextSleepTime ¶
func (retryer *RepeatableExponentialRetryer) NextSleepTime(attempt int) time.Duration
NextSleepTime calculates the next delay of retry.
Click to show internal directories.
Click to hide internal directories.