timewheel

package
v1.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 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 Notify

type Notify func(context.Context, TimeWheel)

Notify is a function that is called when a timer expires.

type TimeWheel

type TimeWheel interface {
	// TickNext the next tick time
	TickNext(ddl time.Duration)
	// AddRunner add runner
	AddRunner(runner Notify)
	// Stop stop the time wheel
	Stop()
}

TimeWheel time wheel

func NewTimeWheel

func NewTimeWheel(ctx context.Context, maxTickers ...time.Duration) TimeWheel

NewTimeWheel new time wheel

Jump to

Keyboard shortcuts

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