MCPcopy Create free account
hub / github.com/cloudtty/cloudtty / run

Method run

pkg/workerpool/worker_pool.go:128–150  ·  view source on GitHub ↗
(stopCh <-chan struct{})

Source from the content-addressed store, hash-verified

126}
127
128func (w *WorkerPool) run(stopCh <-chan struct{}) {
129 var waitGroup sync.WaitGroup
130 waitGroup.Add(3)
131 go func() {
132 defer waitGroup.Done()
133 w.worker(stopCh)
134 }()
135
136 go func() {
137 defer waitGroup.Done()
138 w.tryHandleRequestQueue(stopCh)
139 }()
140
141 go func() {
142 defer waitGroup.Done()
143 w.tryScaleInWorkerQueue(stopCh)
144 }()
145
146 <-stopCh
147
148 w.queue.ShutDown()
149 waitGroup.Wait()
150}
151
152func (w *WorkerPool) worker(stopCh <-chan struct{}) {
153 for w.processNextCluster() {

Callers 1

RunMethod · 0.95

Calls 4

workerMethod · 0.95
tryHandleRequestQueueMethod · 0.95
tryScaleInWorkerQueueMethod · 0.95
AddMethod · 0.65

Tested by

no test coverage detected