MCPcopy Create free account
hub / github.com/cortexproject/cortex / DiscardAndClose

Method DiscardAndClose

pkg/util/priority_queue.go:76–82  ·  view source on GitHub ↗

DiscardAndClose closes the queue and removes all the items from it.

()

Source from the content-addressed store, hash-verified

74
75// DiscardAndClose closes the queue and removes all the items from it.
76func (pq *PriorityQueue) DiscardAndClose() {
77 pq.lock.Lock()
78 defer pq.lock.Unlock()
79 pq.closed = true
80 pq.queue = nil
81 pq.cond.Broadcast()
82}
83
84// Enqueue adds an operation to the queue in priority order.
85func (pq *PriorityQueue) Enqueue(op PriorityOp) {

Callers 1

TestPriorityQueueCloseFunction · 0.95

Calls 1

BroadcastMethod · 0.45

Tested by 1

TestPriorityQueueCloseFunction · 0.76