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).
Click to show internal directories.
Click to hide internal directories.