Documentation ¶
Overview ¶
Package taskpool provides task pool with variable amount of worker goroutines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Task ¶
type Task func(input interface{}) (output interface{})
Task is a work function with one input parameter and one output.
type TaskPool ¶
type TaskPool struct { Input chan interface{} Output chan interface{} // contains filtered or unexported fields }
TaskPool is task pool with variable amount of worker goroutines. It should be created with New(). There should be only one sender to Input and one receiver from Output. Input must be closed by user before invoking Wait(). Output is closed by Wait().
func (*TaskPool) Resize ¶
Resize changes amount of worker goroutines and returns true if amount was changed.
This method is not thread-safe.
Click to show internal directories.
Click to hide internal directories.