(stopCh <-chan struct{})
| 150 | } |
| 151 | |
| 152 | func (w *WorkerPool) worker(stopCh <-chan struct{}) { |
| 153 | for w.processNextCluster() { |
| 154 | select { |
| 155 | case <-stopCh: |
| 156 | return |
| 157 | default: |
| 158 | } |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | func (w *WorkerPool) processNextCluster() (continued bool) { |
| 163 | key, shutdown := w.queue.Get() |