interval

package
v1.28.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackoffTimer

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

BackoffTimer tracks a given range of intervals with increasing duration

func NewBackoffTimer

func NewBackoffTimer(backoffs ...time.Duration) *BackoffTimer

NewBackoffTimer constructs and returns a *BackoffTimer instance If no backoffs are provided, defaultBackoffs is used. When the last backoff duration has elapsed, the timer will use the final duration for the remainder of the BackoffTimer's lifetime

func (*BackoffTimer) CurrentInterval added in v1.26.0

func (b *BackoffTimer) CurrentInterval() time.Duration

func (*BackoffTimer) IncreaseInterval

func (b *BackoffTimer) IncreaseInterval()

IncreaseInterval bumps the duration of the interval up to the next given value

func (*BackoffTimer) IntervalElapsed

func (b *BackoffTimer) IntervalElapsed() bool

IntervalElapsed returns if the current interval has elapsed

func (*BackoffTimer) Reset

func (b *BackoffTimer) Reset()

Reset returns BackoffTimer to its original empty state

Jump to

Keyboard shortcuts

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