(workerlen int)
| 35 | } |
| 36 | |
| 37 | func NewWorkerPool(workerlen int) *WorkerPool { |
| 38 | return &WorkerPool{ |
| 39 | workerlen: workerlen, |
| 40 | JobQueue: make(chan Job), |
| 41 | WorkerQueue: make(chan chan Job, workerlen), |
| 42 | } |
| 43 | } |
| 44 | func (wp *WorkerPool) Run() { |
| 45 | fmt.Println("初始化worker") |
| 46 | //初始化worker |
nothing calls this directly
no outgoing calls
no test coverage detected