Documentation ¶
Overview ¶
Package retry implements back off retry strategy for session manager channel connection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExponentialRetryer ¶
type ExponentialRetryer struct { CallableFunc func() (interface{}, error) GeometricRatio float64 // a random amount of jitter up to JitterRatio percentage, 0.0 means no jitter, 0.15 means 15% added to the total wait time. JitterRatio float64 InitialDelayInMilli int MaxDelayInMilli int MaxAttempts int NonRetryableErrors []string }
TODO Move to a common package for retry and merge with HibernateRetryStrategy
func (*ExponentialRetryer) Call ¶
func (retryer *ExponentialRetryer) Call() (channel interface{}, err error)
Call calls the operation and does exponential retry if error happens until it reaches MaxAttempts if specified.
func (*ExponentialRetryer) Init ¶
func (retryer *ExponentialRetryer) Init()
Init initializes the retryer
func (*ExponentialRetryer) NextSleepTime ¶
func (retryer *ExponentialRetryer) NextSleepTime(attempt int) (time.Duration, bool)
NextSleepTime calculates the next delay of retry. Returns next sleep time as well as if it reaches max delay
Click to show internal directories.
Click to hide internal directories.