Schedule enqueus a closure to run on the GoRoutinePool's goroutines.
(task Task)
| 27 | |
| 28 | // Schedule enqueus a closure to run on the GoRoutinePool's goroutines. |
| 29 | func (p *GoRoutinePool) Schedule(task Task) { |
| 30 | select { |
| 31 | case p.work <- task: |
| 32 | case p.sem <- struct{}{}: |
| 33 | go p.worker(task) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | // Stop sends a stop signal to all running goroutines. |
| 38 | func (p *GoRoutinePool) Stop() { |
no test coverage detected