Pool is a pool of goroutines used to execute tasks concurrently. Tasks are submitted with Go(). Once all your tasks have been submitted, you must call Wait() to clean up any spawned goroutines and propagate any panics. Goroutines are started lazily, so creating a new pool is cheap. There will neve
| 28 | // tasks. Startup and teardown come with an overhead of around 1µs, and each |
| 29 | // task has an overhead of around 300ns. |
| 30 | type Pool struct { |
| 31 | handle conc.WaitGroup |
| 32 | limiter limiter |
| 33 | tasks chan func() |
| 34 | initOnce sync.Once |
| 35 | } |
| 36 | |
| 37 | // Go submits a task to be run in the pool. If all goroutines in the pool |
| 38 | // are busy, a call to Go() will block until the task can be started. |
nothing calls this directly
no outgoing calls
no test coverage detected