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{} // 利用channel来传输任务 // contains filtered or unexported fields }
DelayQueue 延时队列
func NewDelayQueue ¶
func NewDelayQueue(size int) *DelayQueue
func (*DelayQueue) Offer ¶
func (queue *DelayQueue) Offer(val interface{}, expiration int64)
Offer 往队列里加入一个任务
func (*DelayQueue) Poll ¶
func (queue *DelayQueue) Poll(exitC chan struct{}, nowF func() int64)
Poll 拉取任务
Click to show internal directories.
Click to hide internal directories.