(timeout <-chan time.Time)
| 187 | } |
| 188 | |
| 189 | func (w *worker) registerInPool(timeout <-chan time.Time) (ok bool) { |
| 190 | // register this worker in the pool |
| 191 | select { |
| 192 | case w.pool <- w.todo: |
| 193 | return true |
| 194 | case <-timeout: |
| 195 | // failed to register; means WorkerPool is full == there are |
| 196 | // enough workers with not enough work! |
| 197 | return false |
| 198 | case <-w.quit: |
| 199 | return false |
| 200 | case <-w.poolQuit: |
| 201 | return false |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | func (w *worker) executeJob() (ok bool) { |
| 206 | select { |