Versions in this module Expand all Collapse all v1 v1.0.0 Mar 13, 2026 Changes in this version + var ErrFunctionTimeout = errors.New("function timeout") + var ErrNilFunction = errors.New("function to execute is nil") + var ErrPanic = errors.New("error panic") + func FanInOut(ctx context.Context, goroutines int, buffer int, in chan interface{}, ...) + func GetMessageOrTimeout(timeout time.Duration, msg chan []byte, def []byte) []byte + func MergeChannels(input ...<-chan interface{}) <-chan interface + func RecoverWrapper(ctx context.Context, next ExecuteFunc) (err error) + func RunAsyncMultipleWorkers(ctx context.Context, goroutines int, buffer int, ...) <-chan interface + func RunSyncMultipleWorkers(ctx context.Context, goroutines int, fn func(ctx context.Context)) + type Aggregator struct + func NewAggregator[K any](ctx context.Context, goroutines, count int, ticker time.Duration, ...) *Aggregator[K] + func (w *Aggregator[K]) Add(req K) + func (w *Aggregator[K]) Close() + func (w *Aggregator[K]) Count() int + func (w *Aggregator[K]) Flusher() error + func (w *Aggregator[K]) Process() error + func (w *Aggregator[K]) Wait() + type ExecuteFunc func(ctx context.Context) error + func FunctionWithTimeout(timeout time.Duration, fn ExecuteFunc) ExecuteFunc + type Pool struct + func NewPool(ctx context.Context, ...) *Pool + func (p *Pool) Close() + func (p *Pool) Execute(fn ExecuteFunc) + func (p *Pool) Wait() error + type Worker struct + func NewWorker(ctx context.Context, fn func(ctx context.Context) error) *Worker + func (w *Worker) Cancel() + func (w *Worker) Context() context.Context + func (w *Worker) Handle() error + func (w *Worker) ID() string + func (w *Worker) IsStopped() bool + type WorkersPool struct + func NewWorkersPool[K any](ctx context.Context) *WorkersPool[K] + func (w *WorkersPool[K]) Execute(fn func(ctx context.Context) error) + func (w *WorkersPool[K]) Get(id string) (*Worker, bool) + func (w *WorkersPool[K]) PersistentWorker(ctx context.Context, ch chan K, handler func(context.Context, K) error) error + func (w *WorkersPool[K]) Remove(id string) + func (w *WorkersPool[K]) Size() uint64 + func (w *WorkersPool[K]) Stop() + func (w *WorkersPool[K]) TemporalWorker(ctx context.Context, idleTimeout time.Duration, timeout func(), ch chan K, ...) error + func (w *WorkersPool[K]) Wait() error