ticker

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseDelay  time.Duration
	Multiplier float64
	MaxDelay   time.Duration
}

func (*Config) Validate

func (cfg *Config) Validate()

type Delay

type Delay interface {
	Reset()
	Step() time.Duration
}

type ExponentialDelay

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

func NewExponentialDelay

func NewExponentialDelay(cfg *Config) *ExponentialDelay

func (*ExponentialDelay) Reset

func (d *ExponentialDelay) Reset()

func (*ExponentialDelay) Step

func (d *ExponentialDelay) Step() time.Duration

type Option

type Option func(*VariableTicker)

func WithContext

func WithContext(ctx context.Context) Option

type VariableTicker

type VariableTicker struct {
	C chan struct{}
	// contains filtered or unexported fields
}

func New

func New(delay Delay, opts ...Option) *VariableTicker

func (*VariableTicker) Reset

func (t *VariableTicker) Reset()

func (*VariableTicker) Stop

func (t *VariableTicker) Stop()

Jump to

Keyboard shortcuts

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