backofftimer

package
v0.0.0-...-2a45ea8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

Option represents an optional parameter.

func WithTimerProvider

func WithTimerProvider(timerProvider timerImpl.Provider) Option

WithTimerProvider specifies an abstract timer implementation to use. Standard timer implementation is used by default.

type Timer

type Timer interface {
	Start(f func())
	Stop()
}

Timer represents a back-off timer.

Start method starts/restarts the timer. The supplied function is invoked when the timer expires. Each subsequent restart increases the timeout duration.

Stop method stops the timer and resets the timeout duration back to the initial value.

func New

func New(d time.Duration, args ...Option) Timer

Jump to

Keyboard shortcuts

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