Length returns the length of the queue.
()
| 54 | |
| 55 | // Length returns the length of the queue. |
| 56 | func (pq *PriorityQueue) Length() int { |
| 57 | pq.lock.Lock() |
| 58 | defer pq.lock.Unlock() |
| 59 | return len(pq.queue) |
| 60 | } |
| 61 | |
| 62 | // Close signals that the queue should be closed when it is empty. |
| 63 | // A closed queue will not accept new items. |
no outgoing calls