Documentation ¶
Overview ¶
Package workerpool implements a simple goroutine-based workerpool with a configurable number of workers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool is a pool of goroutine workers.
Notes:
- The pool is always constructed with one active worker goroutine.
- Once closed, it can not be used anymore.
func (*Pool) Quit ¶
func (p *Pool) Quit() <-chan struct{}
Quit returns a channel that will be closed when the pool stops.
func (*Pool) Resize ¶
Resize sets the number of parallel goroutine workers to the number given.
newCount must be greater than 0.
Click to show internal directories.
Click to hide internal directories.