MCPcopy Create free account
hub / github.com/LyricTian/queue / Terminate

Method Terminate

list_queue.go:103–115  ·  view source on GitHub ↗

Terminate terminate the queue to receive the task and release the resource

()

Source from the content-addressed store, hash-verified

101
102// Terminate terminate the queue to receive the task and release the resource
103func (q *ListQueue) Terminate() {
104 if atomic.LoadUint32(&q.running) != 1 {
105 return
106 }
107
108 atomic.StoreUint32(&q.running, 0)
109 q.wg.Wait()
110
111 for i := 0; i < q.maxWorker; i++ {
112 q.workers[i].Stop()
113 }
114 close(q.workerPool)
115}

Callers 3

TestListQueueFunction · 0.95
ExampleListQueueFunction · 0.95
BenchmarkListQueueFunction · 0.95

Calls 2

StopMethod · 0.80
WaitMethod · 0.65

Tested by 3

TestListQueueFunction · 0.76
ExampleListQueueFunction · 0.76
BenchmarkListQueueFunction · 0.76