Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WorkPool ¶
func WorkPool[InputItem any, OutputItem any](workerCount int, inputItems []InputItem, operation func(InputItem) OutputItem, resultProcessor func(OutputItem))
WorkPool processes a slice of input items using a limited number of goroutines. The order in which output items are sent to the result processor is not guaranteed. [workerCount] is the number of goroutines that will work concurrently on the input items. [workItems] is a slice containing the input items that will be worked on. [operation] is a function that will execute within a goroutine and perform an operation on an input item and return an output item. [resultProcessor] is a function that executes on the calling thread and processes each output item generated by the work pool.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.