Versions in this module Expand all Collapse all v1 v1.5.1 May 14, 2026 v1.5.0 May 13, 2026 Changes in this version + type Config struct + EnableMetrics bool + MaxWorkers int + QueueSize int + TaskTimeout time.Duration + WorkerTimeout time.Duration + func DefaultConfig() *Config + func (c *Config) Validate() error + type Job struct + EndTime time.Time + Error error + ResultCh chan<- JobResult + StartTime time.Time + SubmitTime time.Time + Task Task + type JobResult struct + Duration time.Duration + EndTime time.Time + Error error + JobID string + StartTime time.Time + Task Task + type Metrics struct + AverageExecTime time.Duration + JobsCompleted int64 + JobsFailed int64 + JobsSubmitted int64 + TotalWorkers int32 + WorkersActive int32 + type Task interface + Execute func(ctx context.Context) error + ID func() string + type TaskFunc struct + func NewTaskFunc(id string, fn func(ctx context.Context) error) *TaskFunc + func (tf *TaskFunc) Execute(ctx context.Context) error + func (tf *TaskFunc) ID() string + type WorkerPool struct + func New(config *Config) *WorkerPool + func (wp *WorkerPool) GetMetrics() Metrics + func (wp *WorkerPool) IsRunning() bool + func (wp *WorkerPool) Start() error + func (wp *WorkerPool) Stop() error + func (wp *WorkerPool) Submit(task Task) error + func (wp *WorkerPool) SubmitWithResult(task Task, resultCh chan<- JobResult) error