parallel

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatFailureError

func FormatFailureError(failures []string, total int) error

FormatFailureError returns a summary error for failed operations, or nil if there are no failures. Each entry in failures should be a pre-formatted line.

func MaxWorkers

func MaxWorkers(configured, total int) int

MaxWorkers returns the bounded number of concurrent workers to use. Falls back to runtime.NumCPU() when configured is 0, and caps at total. The minimum return value is 1.

func RunFanOut

func RunFanOut[T any, R any](items []T, workers int, fn func(T) R) []R

RunFanOut executes fn for each item using up to workers goroutines. Results are returned in the same order as items.

Types

This section is empty.

Jump to

Keyboard shortcuts

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