Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Strategy ¶
type Strategy interface { // Delay returns the delay for next request. Delay() time.Duration // Observe recalculates the next delay based on the feedback. Observe(err error) }
Strategy handles delays based on feedbacks provided
func NewDefaultStrategy ¶
func NewDynamicStrategy ¶
func NewDynamicStrategy( minDelay time.Duration, maxDelay time.Duration, errorsBeforeIncreasingDelay int, successesBeforeDecreasingDelay int, successesBeforeResettingDelay int, noRequestsTimeoutBeforeDecreasingDelay time.Duration, noRequestsTimeoutBeforeResettingDelay time.Duration, clock clock.Clock) (Strategy, error)
Click to show internal directories.
Click to hide internal directories.