Versions in this module Expand all Collapse all v0 v0.0.67 Feb 16, 2026 Changes in this version + var ErrClosed = errors.New("queue closed") + var ErrVirtualPoolClosed = errors.New("virtual pool closed for submit") + func WorkerIndexFromContext(ctx context.Context) (int, bool) + type ErrorCollector struct + func (ec *ErrorCollector) Errors() []error + type Pool struct + func NewWorkerPool[T any](parent context.Context, workerCount int) *Pool[T] + func (p *Pool[T]) CloseForSubmit() + func (p *Pool[T]) Start(handler func(ctx context.Context, item T, submit func(T) error) error) + func (p *Pool[T]) Submit(item T) error + func (p *Pool[T]) Wait() error + type SharedTaskPool struct + func NewSharedTaskPool(parent context.Context, workerCount int) *SharedTaskPool + func (s *SharedTaskPool) CloseForSubmit() + func (s *SharedTaskPool) NewVirtualPool(mode VirtualMode) VirtualPoolI + func (s *SharedTaskPool) Wait() error + type Task interface + Run func(ctx context.Context, submit func(Task) error) error + type TaskFunc func(ctx context.Context, submit func(Task) error) error + func (f TaskFunc) Run(ctx context.Context, submit func(Task) error) error + type VirtualMode int + const VirtualFailFast + const VirtualTolerant + type VirtualPool struct + func (v *VirtualPool) CloseAndWait() + func (v *VirtualPool) CloseForSubmit() + func (v *VirtualPool) Errors() []error + func (v *VirtualPool) FirstError() error + func (v *VirtualPool) Submit(t Task) error + func (v *VirtualPool) SubmitFunc(f TaskFunc) error + func (v *VirtualPool) Wait() + type VirtualPoolFactory interface + NewVirtualPool func(mode VirtualMode) VirtualPoolI + type VirtualPoolI interface + CloseAndWait func() + CloseForSubmit func() + Errors func() []error + FirstError func() error + Submit func(Task) error + SubmitFunc func(TaskFunc) error + Wait func() + type WorkerPoolQueue struct + func NewWorkerPoolQueue[T any]() *WorkerPoolQueue[T] + func (q *WorkerPoolQueue[T]) Close() + func (q *WorkerPoolQueue[T]) Get() (T, bool) + func (q *WorkerPoolQueue[T]) Len() int + func (q *WorkerPoolQueue[T]) Put(v T) error + func (q *WorkerPoolQueue[T]) TryGet() (T, bool)