sdbackoff

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package sdbackoff 计算补偿间隔

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retry

func Retry(b BackOff, action func() error) error

Types

type BackOff

type BackOff = backoff.BackOff

func Const

func Const(d time.Duration) BackOff

func Exponential

func Exponential(opts *ExponentialOptions) BackOff

func Stop

func Stop() BackOff

func Synchronized

func Synchronized(b BackOff) BackOff

func Zero

func Zero() BackOff

type ExponentialOptions

type ExponentialOptions struct {
	InitialInterval     time.Duration
	RandomizationFactor float64
	Multiplier          float64
	MaxInterval         time.Duration
	MaxElapsedTime      time.Duration
}

type Ticker

type Ticker = backoff.Ticker

func TickerOf

func TickerOf(b BackOff) *Ticker

Jump to

Keyboard shortcuts

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