Documentation
¶
Index ¶
- type Option
- type Task
- type Ticker
- type TimeWheel
- func (tw *TimeWheel) Add(delay time.Duration, callback func()) *Task
- func (tw *TimeWheel) AddCron(delay time.Duration, callback func()) *Task
- func (tw *TimeWheel) After(delay time.Duration) <-chan time.Time
- func (tw *TimeWheel) AfterFunc(delay time.Duration, callback func()) *Timer
- func (tw *TimeWheel) NewTicker(delay time.Duration) *Ticker
- func (tw *TimeWheel) NewTimer(delay time.Duration) *Timer
- func (tw *TimeWheel) Remove(task *Task) error
- func (tw *TimeWheel) Sleep(delay time.Duration)
- func (tw *TimeWheel) Start()
- func (tw *TimeWheel) Stop()
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶ added in v0.0.4
func WithGoPool ¶ added in v0.0.4
func WithGoPool(goPool *gopool.GoroutinePool) Option
WithGoPool
@Description: 设置执行池 @param goPool @return Option
type TimeWheel ¶
TimeWheel
@Description: 时间轮 的实现 代码参考自 https://github.com/rfyiamcool/go-timewheel
func NewTimeWheel ¶
NewTimeWheel create new time wheel
type Timer ¶
Timer similar to golang std timer
func (*Timer) AddStopFunc ¶
func (t *Timer) AddStopFunc(callback func())
Click to show internal directories.
Click to hide internal directories.