Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
func NewWorkerPool ¶
func NewWorkerPool(workerCount int) *WorkerPool
func (*WorkerPool) CapacityAvailable ¶ added in v0.2.0
func (p *WorkerPool) CapacityAvailable() <-chan struct{}
CapacityAvailable coalesces capacity releases and increases into a nonblocking hint. Receivers must recheck FreeWorkers; the channel is never closed.
func (*WorkerPool) Close ¶
func (p *WorkerPool) Close()
func (*WorkerPool) FreeWorkers ¶
func (p *WorkerPool) FreeWorkers() int
func (*WorkerPool) Resize ¶
func (p *WorkerPool) Resize(n int)
func (*WorkerPool) Submit ¶
func (p *WorkerPool) Submit(task Task) error
func (*WorkerPool) Workers ¶ added in v0.2.0
func (p *WorkerPool) Workers() int
Workers returns the current size of the worker pool.
Click to show internal directories.
Click to hide internal directories.