Versions in this module Expand all Collapse all v0 v0.0.1 Sep 9, 2024 Changes in this version + var ChanIsCloseError = errors.New("chan is close") + var ChanIsEmptyError = errors.New("chan is empty") + var ContextIsNilError = errors.New("context is nil") + var MaxWorkersReachedError = errors.New("maximum number of workers reached") + var WorkerIsNilError = errors.New("worker is nil") + var WorkerPoolStopError = errors.New("worker pool is stopped") + func Exclude[T comparable](elements []T, element T) []T + func GetRecoverError(rec any) error + type Error struct + Error error + Instance Worker + type Options struct + Context context.Context + MaxRetryWorkerRestart int32 + Queue chan Task + WorkerCount int32 + type Pool interface + AddTaskInQueue func(task Task) error + AddWorker func(wr Worker) error + Run func() + RunningWorkers func() int32 + Stop func() + type Processing interface + Processing func(ctx context.Context, input interface{}) + type Status int + const StatusWorkerIdle + const StatusWorkerRunning + const StatusWorkerStopped + type Task interface + GetError func() error + Run func() + SetContext func(ctx context.Context) error + SetDoneChannel func(done chan struct{}) error + SetWaitGroup func(wg *sync.WaitGroup) error + Stop func() + String func() string + type Worker interface + GetError func() chan *Error + GetRetry func() int32 + GetStatus func() Status + Restart func(wg *sync.WaitGroup) + SetContext func(ctx context.Context) error + SetQueue func(queue chan Task) error + SetWorkerErrChannel func(errCh chan *Error) error + Start func(wg *sync.WaitGroup) + Stop func() <-chan struct{} + String func() string