thread

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parallelize

func Parallelize(ctx context.Context, jobs []func(context.Context) error, options ...ParallelizeOption) error

Parallelize runs the jobs in parallel.

Returns the combined error from the jobs.

Types

type ParallelizeOption

type ParallelizeOption func(*parallelizeOptions)

ParallelizeOption is an option to Parallelize.

func ParallelizeWithCancelOnFailure

func ParallelizeWithCancelOnFailure() ParallelizeOption

ParallelizeWithCancelOnFailure returns a new ParallelizeOption that will attempt to cancel all other jobs via context cancellation if any job fails.

func WithParallelism

func WithParallelism(parallelism int) ParallelizeOption

WithParallelism returns a new ParallelizeOption that will run up to the given number of goroutines simultaneously.

Values less than 1 are ignored.

The default is runtime.GOMAXPROCS(0).

Jump to

Keyboard shortcuts

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