Versions in this module Expand all Collapse all v6 v6.6.0 Jun 13, 2023 Changes in this version + type HandleWorkError struct + Data []interface{} + ErrorMessage string + WorkerID int + func NewHandleWorkError(errorMessage string, workerID int, data []interface{}) HandleWorkError + func (hwe HandleWorkError) Error() string + type Pool interface + type WorkConfiguration struct + Handler WorkHandler + MaxRetries int + Retriever WorkRetriever + type WorkHandler interface + ProcessWork func(workerID int, data []interface{}, limiter ratelimit.Limiter) error + type WorkItem struct + Data interface{} + Handler WorkHandler + type WorkItemCollection []WorkItem + func (wic WorkItemCollection) Handle(workerID int, limiter ratelimit.Limiter, handler WorkHandler) error + type WorkRetriever interface + RetrieveWork func(handler WorkHandler) ([]WorkItem, error) + type WorkerPool struct + func NewWorkerPool(config WorkerPoolConfig) *WorkerPool + func (wp *WorkerPool) AddWorkConfiguration(config WorkConfiguration) + func (wp *WorkerPool) Run(ctx context.Context) + type WorkerPoolConfig struct + Logger *logrus.Entry + NumWorkers int + RateLimitPerSecond int + TickFrequency time.Duration