Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(c *option)
func WithMinHeap ¶
func WithMinHeap() Option
func WithTimeWheel ¶
func WithTimeWheel() Option
type Timer ¶
type Timer interface { // 一次性定时器 AfterFunc(expire time.Duration, callback func()) TimeNoder // 周期性定时器 ScheduleFunc(expire time.Duration, callback func()) TimeNoder // 自定义下次的时间 CustomFunc(n Next, callback func()) TimeNoder // 运行 Run() // 停止所有定时器 Stop() }
定时器接口
type Timerv2 ¶
type Timerv2 interface { // 一次性定时器 //TimerStart(expire time.Duration, m interface{}, callback func(t TimeNoder, v interface{})) TimeNoder // 周期性定时器 TimerLoopInit(expire time.Duration, m interface{}, callback func(t TimeNoder, v interface{})) TimeNoder // 运行 TimerStart() }
定时器接口 version 2
Source Files ¶
Click to show internal directories.
Click to hide internal directories.