Versions in this module Expand all Collapse all v0 v0.1.2 Nov 4, 2026 v0.1.0 Nov 3, 2026 Changes in this version + var ErrClosed = errors.New("taskpool: closed") + var ErrInvalidConfig = errors.New("taskpool: invalid config") + var ErrInvalidTask = errors.New("taskpool: invalid task") + var ErrNoDefault = errors.New("taskpool: no default pool") + func SetDefault(p *Pool) + func Shutdown() error + func Submit(ctx context.Context, name string, fn func(context.Context) error) error + func Wait() error + type Config struct + DrainTimeout time.Duration + IdleTimeout time.Duration + MaxRetries int + MaxWorkers int + MinWorkers int + QueueSize int + SubmitTimeout time.Duration + type Pool struct + func Default() *Pool + func New(cfg Config) (*Pool, error) + func NewDefault(cfg Config) (*Pool, error) + func Swap(p *Pool) *Pool + func (p *Pool) Shutdown() error + func (p *Pool) Stats() Stats + func (p *Pool) Submit(ctx context.Context, name string, fn func(context.Context) error) error + func (p *Pool) Wait() error + type Stats struct + Abandoned uint64 + Accepted uint64 + Failed uint64 + Pending int + Running int + Succeeded uint64 + Workers int