Simple worker pool library
It is often said that there is no need for a general purpose worker pool library for go
, and that you can do everything with the basic chan
primitive. However, it is relatively easy to
make mistakes in safely catering for edge cases. This library aims to make it simple to embed worker pool logic into your project.
The worker pool simply accepts work in the form of functions func()
. Parameters are expected to be passed into the work function via closures and return values are expected to be
implemented by the calling code using whatever mechanism is required (i.e. chan
or otherwise).