run

package
v0.2024.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConcurrency = 30

Variables

This section is empty.

Functions

func Collect

func Collect[T any](ctx context.Context, concurrency int, fns ...func() (T, error)) (returns []T, errs []error)

Collect runs fns in parallel with a maximum concurrency of concurrency. The response of running fns[i] is placed into returns[i] or errs[i]. If ctx is done before all fns have finished, the ctx err is placed into errs[i] for each incomplete fn.

func InParallel

func InParallel(ctx context.Context, concurrency int, fns ...func()) error

InParallel runs fns in parallel with a maximum concurrency of concurrency. The ctx parameter can be used to cancel the start of new fns. Cancellation of running fns is the responsibility of the caller. InParallel returns once all started fns have finished or ctx is done.

Types

This section is empty.

Jump to

Keyboard shortcuts

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