retry

package
v0.0.104 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BaseDelay = 5
	MaxDelay  = 60 * 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DecorRelatedJitter

type DecorRelatedJitter struct {
}

DecorRelatedJitter 去相关抖动退避 delay = min(最大等待时间, random(基础等待时间, 基础等待时间* 3);

func (*DecorRelatedJitter) ComputeDelayBeforeNextRetry

func (d *DecorRelatedJitter) ComputeDelayBeforeNextRetry() int32

type EqualJitter

type EqualJitter struct {
}

EqualJitter 等抖动指数退避 delay = Exponential/2 + random(0, Exponential/2)

func (*EqualJitter) ComputeDelayBeforeNextRetry

func (e *EqualJitter) ComputeDelayBeforeNextRetry() int32

type Exponential

type Exponential struct {
}

Exponential 指数退避 delay = min(最大等待时间, 基础等待时间 * (2^已重试次数))

func (*Exponential) ComputeDelayBeforeNextRetry

func (e *Exponential) ComputeDelayBeforeNextRetry() int32

type None

type None struct {
}

func (*None) ComputeDelayBeforeNextRetry

func (n *None) ComputeDelayBeforeNextRetry() int32

type RandomJitter

type RandomJitter struct {
}

RandomJitter 全抖动指数退避 delay = random(0, Exponential)

func (*RandomJitter) ComputeDelayBeforeNextRetry

func (r *RandomJitter) ComputeDelayBeforeNextRetry() int32

type Strategy

type Strategy interface {
	ComputeDelayBeforeNextRetry() int32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL