PopFirst removes and returns the next timer to be scheduled and the time at which it is scheduled to run.
()
| 82 | // PopFirst removes and returns the next timer to be scheduled and |
| 83 | // the time at which it is scheduled to run. |
| 84 | func (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 |