retry

package
v0.0.0-...-df6d72d Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExpRetry

type ExpRetry struct {
	// contains filtered or unexported fields
}

ExpRetry increase wait time exponentially with try number (delay = minDelay * baseMultiplier ^ attempt)

func NewExpRetry

func NewExpRetry(maxRetries int, baseMultiplier int, minDelay time.Duration, maxDelay *time.Duration) *ExpRetry

func (*ExpRetry) Iterator

func (r *ExpRetry) Iterator() *ExpRetryIterator

type ExpRetryConfig

type ExpRetryConfig struct {
	MaxRetries     int              `yaml:"max_retries,omitempty" json:"max_retries"`
	BaseMultiplier int              `yaml:"base_multiplier,omitempty" json:"base_multiplier"`
	MinDelay       fields.Duration  `yaml:"min_delay,omitempty" json:"min_delay" swaggertype:"primitive,string"`
	MaxDelay       *fields.Duration `yaml:"max_delay,omitempty" json:"max_delay" swaggertype:"primitive,string"`
}

func DefaultExpRetryConfig

func DefaultExpRetryConfig() *ExpRetryConfig

type ExpRetryIterator

type ExpRetryIterator struct {
	// contains filtered or unexported fields
}

func (*ExpRetryIterator) HasNext

func (i *ExpRetryIterator) HasNext() bool

func (*ExpRetryIterator) WaitNext

func (i *ExpRetryIterator) WaitNext(ctx context.Context) error

Jump to

Keyboard shortcuts

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