Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultParallelism = 100 DefaultTimeout = 60 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func For ¶
For performs work for each item in the input slice in parallel. It performs work for all items and returns the first encountered error. In practice, execution of all subsequent items will be cancelled right away because the context is cancelled upon first error.
func Map ¶
func Map[T any, T2 any]( ctx context.Context, items []T, fn MapFn[T, T2], options ...Option, ) ([]T2, error)
Map maps input items to output items in parallel. It performs work for all items and returns a results slice and the first encountered error. In practice, execution of all subsequent items will be cancelled right away because the context is cancelled upon first error.
Types ¶
Click to show internal directories.
Click to hide internal directories.