NewPriorityQueue makes a new priority queue.
(lengthGauge prometheus.Gauge)
| 44 | |
| 45 | // NewPriorityQueue makes a new priority queue. |
| 46 | func NewPriorityQueue(lengthGauge prometheus.Gauge) *PriorityQueue { |
| 47 | pq := &PriorityQueue{ |
| 48 | lengthGauge: lengthGauge, |
| 49 | } |
| 50 | pq.cond = sync.NewCond(&pq.lock) |
| 51 | heap.Init(&pq.queue) |
| 52 | return pq |
| 53 | } |
| 54 | |
| 55 | // Length returns the length of the queue. |
| 56 | func (pq *PriorityQueue) Length() int { |
no outgoing calls