timer

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WheelLength    = 64
	TimeNearShift  = 8
	TimeNear       = 1 << TimeNearShift
	TimeNearMask   = TimeNear - 1
	TimeLevelShift = 6
	TimeLevel      = 1 << TimeLevelShift
	TimeLevelMask  = TimeLevel - 1

	TimingTypeTimeout = 0
	TimingTypeTick    = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeWheel

type TimeWheel[T any] struct {
	// contains filtered or unexported fields
}

func NewTimeWheel

func NewTimeWheel[T any](interval time.Duration, cb func(T)) *TimeWheel[T]

func (*TimeWheel[T]) Timeout

func (tw *TimeWheel[T]) Timeout(timeout time.Duration, data T)

Jump to

Keyboard shortcuts

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