(stopCh <-chan struct{})
| 126 | } |
| 127 | |
| 128 | func (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 | |
| 152 | func (w *WorkerPool) worker(stopCh <-chan struct{}) { |
| 153 | for w.processNextCluster() { |
no test coverage detected