Versions in this module Expand all Collapse all v1 v1.0.1 Jan 30, 2026 v1.0.0 Jan 28, 2026 Changes in this version + func GoSafely(f func() error) <-chan error + func Parallel[In any, Out any](items []In, worker func(arg In, index int) ([]Out, error)) ([]Out, error) + func ProcessInWorkQueue[TIn, TOut any](in []TIn, workerFunc func(TIn) ([]TOut, error), numWorkers int, bufferSize int, ...) ([]TOut, error) + func RunTasks[T any](tasks ...*Task[T]) ([]T, error) + func StartJobs(jobs []BackgroundJob) + func WaitGroup(copies int, worker func() error) error + type BackgroundJob interface + Name func() string + Start func() <-chan error + Stop func() + type ErrorCallback func(T, error, int) + type Handler func(T) error + type PanicError struct + func (p *PanicError) Error() string + func (p *PanicError) Stack() string + type Partitionable interface + PartitionKey func() string + type RetryPolicy int32 + const RetryPolicyAfterDuration + const RetryPolicyImmediately + const RetryPolicyNever + type Task struct + func NewTask[T any](worker func() (T, error)) *Task[T] + func (t *Task[T]) Await() (T, error) + func (t *Task[T]) Run() + type TaskResult struct + Error error + Value T + type WorkItem struct + Item T + Retries int + type WorkQueue struct + ErrorCallback ErrorCallback[T] + MaxRetries int + PartitionFunc func(T) string + RetryAfterDuration time.Duration + RetryPolicy RetryPolicy + StopOnError bool + func NewWorkQueue[T any](handler Handler[T], bufferSize int, workerCount int) *WorkQueue[T] + func (q *WorkQueue[T]) AwaitCompletion() + func (q *WorkQueue[T]) Enqueue(items ...T) + func (q *WorkQueue[T]) Error() error + func (q *WorkQueue[T]) IsRunning() bool + func (q *WorkQueue[T]) Start() + func (q *WorkQueue[T]) Stop()