Start launches all worker goroutines.
()
| 60 | |
| 61 | // Start launches all worker goroutines. |
| 62 | func (p *WorkerPool) Start() { |
| 63 | for i := 0; i < p.workers; i++ { |
| 64 | p.wg.Add(1) |
| 65 | go p.worker(i) |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // Stop gracefully shuts down the pool and waits for workers to finish. |
| 70 | func (p *WorkerPool) Stop() { |