Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidParallelism = errors.New("degree of parallelism must be > 0")
Functions ¶
func ForEach ¶
ForEach processes data in parallel. total is the total number of items to process. n is the degree of parallelism. process is called with the index of the item being processed.
ParallelFor acts as a semaphore over a total WaitGroup fan-out, and also coalesces errors into a single error result.
If callers need process to return actual data, they should allocate a slice of the data they need, and assign to the slice index while processing. See ParallelForFiles for an example usage.
Types ¶
Click to show internal directories.
Click to hide internal directories.