BoundedWaitGroup like a normal wait group except limits number of active goroutines to given capacity.
| 4 | |
| 5 | // BoundedWaitGroup like a normal wait group except limits number of active goroutines to given capacity. |
| 6 | type BoundedWaitGroup struct { |
| 7 | wg sync.WaitGroup |
| 8 | ch chan struct{} // Chan buffer size is used to limit concurrency. |
| 9 | } |
| 10 | |
| 11 | // New creates a BoundedWaitGroup with the given concurrency. |
| 12 | func New(capacity uint) BoundedWaitGroup { |
nothing calls this directly
no outgoing calls
no test coverage detected