Closed husy-dev closed 1 year ago
func (p *WorkerPool) dispatch() { for i := 0; i < p.maxWorkers; i++ { p.taskQueue[i] = make(chan func(), 1024) go startWorker(p.taskQueue[i]) } }
since function dispatch execute startWorker by goroutine, there is no need for startWorker to use goroutine inside.
since function dispatch execute startWorker by goroutine, there is no need for startWorker to use goroutine inside.