Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DelayQueue ¶
type DelayQueue struct { C chan interface{} // contains filtered or unexported fields }
func NewDelayQueue ¶
func NewDelayQueue(size int) *DelayQueue
func (*DelayQueue) Poll ¶
func (dq *DelayQueue) Poll(exitC chan struct{}, nowF func() int64)
func (*DelayQueue) Push ¶
func (dq *DelayQueue) Push(elem interface{}, expiration int64)
type TimingWheel ¶
type TimingWheel struct {
// contains filtered or unexported fields
}
func NewTimingWheel ¶
func NewTimingWheel(tick time.Duration, wheelSize int64) *TimingWheel
精度:tick | wheelSize:槽数
func (*TimingWheel) AfterFunc ¶
func (tw *TimingWheel) AfterFunc(d time.Duration, f func()) *Timer
通过这个函数来指定定时时间和执行函数
func (*TimingWheel) ScheduleFunc ¶
func (tw *TimingWheel) ScheduleFunc(s Scheduler, f func()) (t *Timer)
func (*TimingWheel) Start ¶
func (tw *TimingWheel) Start()
func (*TimingWheel) Stop ¶
func (tw *TimingWheel) Stop()
Click to show internal directories.
Click to hide internal directories.