pipeline

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parallel

func Parallel[T any](items []T, fn func(T) error) []error

Parallel runs jobs concurrently without limits and collects all errors.

func ParallelMap

func ParallelMap[T any, R any](items []T, fn func(T) (R, error)) ([]R, []error)

ParallelMap maps items concurrently while preserving order, returning elements and collected errors.

func Pool

func Pool[T any](items []T, concurrency int, fn func(T) error) []error

Pool runs jobs concurrently but limits the number of active goroutines to `concurrency`.

func Retry

func Retry(attempts int, delay time.Duration, fn func() error) error

Retry retries a function a given number of times with a specified delay between attempts.

func Sequential

func Sequential[T any](items []T, fn func(T) error) error

Sequential runs jobs sequentially and stops on the first error.

func WithTimeout

func WithTimeout[T any](d time.Duration, fn func() (T, error)) (T, error)

WithTimeout runs a function with a timeout, returning an error if it takes too long.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL