func New(n int, ctor func() Worker) *Pool {
	p := &Pool{
		ctor:    ctor,
		reqChan: make(chan workRequest),
	}
	p.SetSize(n)
	return p
}
New creates a new Pool of workers that starts with n workers. You must
provide a constructor function that creates new Worker types and when you
change the size of the pool the constructor will be called to create each new
Worker.
package tunny
import (
	"errors"
	"sync"
	"sync/atomic"
	"time"
)
var (
	ErrPoolNotRunning = errors.New("the pool is not running")
	ErrJobNotFunc     = errors.New("generic worker not given a func()")
	ErrWorkerClosed   = errors.New("worker was closed")
	ErrJobTimedOut    = errors.New("job request timed out")
)
type Worker interface {
	Process(interface{}) interface{}
	BlockUntilReady()
	Interrupt()
	Terminate()
}
type closureWorker struct {
	processor func(interface{}) interface{}
}
func (w *closureWorker) Process(payload interface{}) interface{} {
	return w.processor(payload)
}
func (w *closureWorker) BlockUntilReady() {}
func (w *closureWorker) Interrupt()       {}
func (w *closureWorker) Terminate()       {}
type callbackWorker struct{}
func (w *callbackWorker) Process(payload interface{}) interface{} {
	f, ok := payload.(func())
	if !ok {
		return ErrJobNotFunc
	}
	f()
	return nil
}
func (w *callbackWorker) BlockUntilReady() {}
func (w *callbackWorker) Interrupt()       {}
func (w *callbackWorker) Terminate()       {}
type Pool struct {
	ctor    func() Worker
	workers []*workerWrapper
	reqChan chan workRequest
	workerMut  sync.Mutex
	queuedJobs int64
}