add config for work chan

This commit is contained in:
joy.zhou
2019-07-15 15:10:56 +08:00
parent f15d0db08a
commit 22f9764220

View File

@@ -37,7 +37,7 @@ func (p *WorkerPool) Submit(uid string, task func()) {
func (p *WorkerPool) dispatch() {
for i := 0; i < p.maxWorkers; i++ {
p.taskQueue[i] = make(chan func())
p.taskQueue[i] = make(chan func(), 1024)
go startWorker(p.taskQueue[i])
}
}