timingwheel

package
v0.0.0-...-9e5668c Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Timer

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

Timer 表示计时器

type TimingWheel

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

TimingWheel 实现时间轮

func New

func New(interval time.Duration) *TimingWheel

New 创建时间轮

func (*TimingWheel) AddTimer

func (w *TimingWheel) AddTimer(d time.Duration, callback func() error) error

AddTimer 向时间轮中添加一个计时器

func (*TimingWheel) Start

func (w *TimingWheel) Start()

Start 启动时间轮

func (*TimingWheel) Stop

func (w *TimingWheel) Stop()

Stop 停止时间轮

Jump to

Keyboard shortcuts

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