MCPcopy Create free account
hub / github.com/cloudwan/gohan / Start

Method Start

job/queue.go:57–70  ·  view source on GitHub ↗

Start consuming task

()

Source from the content-addressed store, hash-verified

55
56//Start consuming task
57func (worker *Worker) Start() {
58 go func() {
59 l.Panic(log)
60 for {
61 select {
62 case job := <-worker.queue.queue:
63 job.Run()
64 worker.queue.waitGroup.Done()
65 case <-worker.CloseCh:
66 return
67 }
68 }
69 }()
70}
71
72//Queue manages workers and job
73type Queue struct {

Callers 1

NewQueueFunction · 0.95

Calls 2

PanicMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected