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

Method Run

chan_queue.go:31–43  ·  view source on GitHub ↗

Run start running queues

()

Source from the content-addressed store, hash-verified

29
30// Run start running queues
31func (q *Queue) Run() {
32 if atomic.LoadUint32(&q.running) == 1 {
33 return
34 }
35
36 atomic.StoreUint32(&q.running, 1)
37 for i := 0; i < q.maxWorkers; i++ {
38 q.workers[i] = newWorker(q.workerPool, q.wg)
39 q.workers[i].Start()
40 }
41
42 go q.dispatcher()
43}
44
45func (q *Queue) dispatcher() {
46 for job := range q.jobQueue {

Callers 4

TestQueueFunction · 0.95
TestSyncQueueFunction · 0.95
ExampleQueueFunction · 0.95
BenchmarkQueueFunction · 0.95

Calls 3

dispatcherMethod · 0.95
newWorkerFunction · 0.85
StartMethod · 0.80

Tested by 4

TestQueueFunction · 0.76
TestSyncQueueFunction · 0.76
ExampleQueueFunction · 0.76
BenchmarkQueueFunction · 0.76