Documentation
¶
Overview ¶
Package parallel provides utilities for parallel execution of operations.
Index ¶
Constants ¶
View Source
const DefaultLimit = 10
DefaultLimit is the default concurrency limit for parallel operations.
Variables ¶
This section is empty.
Functions ¶
func ExecuteMap ¶
func ExecuteMap[K comparable, V any, R any]( ctx context.Context, entries map[K]V, fn func(ctx context.Context, key K, value V) (R, error), ) map[K]*Result[R]
ExecuteMap runs fn for each key-value pair in entries concurrently. Results are collected in a map keyed by the same keys as entries. Individual errors are captured in Result.Err rather than failing the entire operation.
Types ¶
Click to show internal directories.
Click to hide internal directories.