(timeout <-chan time.Time)
| 173 | } |
| 174 | |
| 175 | func (w *worker) shouldQuit(timeout <-chan time.Time) (ok bool) { |
| 176 | select { |
| 177 | case <-w.quit: |
| 178 | return true |
| 179 | case <-w.poolQuit: |
| 180 | return true |
| 181 | case <-timeout: |
| 182 | return true |
| 183 | default: |
| 184 | } |
| 185 | |
| 186 | return false |
| 187 | } |
| 188 | |
| 189 | func (w *worker) registerInPool(timeout <-chan time.Time) (ok bool) { |
| 190 | // register this worker in the pool |