Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Remain ¶
type Remain interface { // Expired return expired time in int64 UnixNano Expired() int64 }
Remain for timing wheel task
type SimpleWheel ¶
type SimpleWheel struct {
// contains filtered or unexported fields
}
SimpleWheel a simple multi-level timing wheel
func NewSimpleTimeWheel ¶
func NewSimpleTimeWheel(tick time.Duration, size int64, pool int) *SimpleWheel
NewSimpleTimeWheel return a timimg wheel with size * tick, and executor pool(goroutine) size
func (*SimpleWheel) After ¶
func (w *SimpleWheel) After(d time.Duration, task func()) *Task
After add a task to timing wheel with delay time.
func (*SimpleWheel) AfterRemain ¶
func (w *SimpleWheel) AfterRemain(r Remain, task func()) *Task
AfterRemain add a task to timing wheel with Remain object.
Click to show internal directories.
Click to hide internal directories.