func WithJobCap(n int) Option {
	return func(p *Pool) {
		p.jobCap = n
	}
}
WithJobCap job chan number.
package workpool
import (
	"context"
	"os"
	"os/signal"
	"syscall"
	"time"
)
type Task struct {
	fn func() error
}
func NewTask(fn func() error) *Task {
	return &Task{
		fn: fn,
	}
}
func (t *Task) run(logEntry Logger) {
	if t == nil {
		return
	}
	defer func() {
		if e := recover(); e != nil {
			logEntry.Println("exec current task panic: ", e)
		}
	}()
	err := t.fn()
	if err != nil {
		logEntry.Println("exec task error: ", err)
	}
}
type Logger interface {
	Println(args ...interface{})
}
type Pool struct {
	execInterval   time.Duration
	entryChan      chan *Task      
	entryCap       int             
	jobChan        chan *Task      
	jobCap         int             
	workerCap      int             
	logEntry       Logger          
	stop           chan struct{}   
	interrupt      chan os.Signal  
	entryCloseWait time.Duration   
	shutdownWait   time.Duration   
}
var (
	defaultMaxEntryCap = 10000
	defaultMaxJobCap = 10000
	defaultMaxWorker = 10000
	defaultMinWorker = 3
	est = struct{}{}
	dummyLogger = LoggerFunc(func(...interface{}) {})
)
type LoggerFunc func(...interface{})
func (f LoggerFunc) Println(args ...interface{}) { f(args...) }
type Option func(p *Pool)
func WithExecInterval(t time.Duration) Option {
	return func(p *Pool) {
		p.execInterval = t
	}
}
func WithEntryCap(n int) Option {
	return func(p *Pool) {
		p.entryCap = n
	}
}