MCPcopy Index your code
hub / github.com/beevik/timerqueue / PopFirst

Method PopFirst

queue.go:84–91  ·  view source on GitHub ↗

PopFirst removes and returns the next timer to be scheduled and the time at which it is scheduled to run.

()

Source from the content-addressed store, hash-verified

82// PopFirst removes and returns the next timer to be scheduled and
83// the time at which it is scheduled to run.
84func (q *Queue) PopFirst() (t Timer, tm time.Time) {
85 if len(q.heap) > 0 {
86 data := heap.Pop(&q.heap).(*timerData)
87 delete(q.table, data.timer)
88 return data.timer, data.time
89 }
90 return nil, time.Time{}
91}
92
93// PeekFirst returns the next timer to be scheduled and the time
94// at which it is scheduled to run. It does not modify the contents

Callers 2

TestEmptyQueueFunction · 0.80
TestQueueFunction · 0.80

Calls 1

PopMethod · 0.80

Tested by 2

TestEmptyQueueFunction · 0.64
TestQueueFunction · 0.64