MCPcopy Create free account
hub / github.com/dc0d/workerpool / registerInPool

Method registerInPool

workerpool.go:189–203  ·  view source on GitHub ↗
(timeout <-chan time.Time)

Source from the content-addressed store, hash-verified

187}
188
189func (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
205func (w *worker) executeJob() (ok bool) {
206 select {

Callers 1

beginMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected