Documentation
¶
Overview ¶
Package parallel provides a generic worker pool for concurrent processing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run[T any, R any](items []T, workers int, fn func(T) R, onResult func(completed, total int, result R)) []R
Run executes fn for each item using the given number of workers. The onResult callback is called sequentially from a single goroutine as results complete, making it safe to write to stdout without additional synchronization. Results are returned in completion order.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.