GroupProcessor
The GroupProcessor
class is a generic class that provides parallel processing functionality for collections of elements. It allows users to easily perform parallel operations on a group of items and return the results as different types of collections, such as ConcurrentBag
, ConcurrentDictionary
, or a List
.
The "Group" Processor is for a selection where more than one item can be matched for the given selector, also known as a GroupBy. If you're looking for a single item in and out without grouping, use the SingleProcessor.
ParallelProcess
This method processes the collection in parallel and invokes the provided callback for each group of items with the same key.
Example:
ParallelProcessToBag
This method processes the collection in parallel and adds the results to a ConcurrentBag
by invoking the provided callback for each group of items with the same key.
Example:
ParallelProcessToDictionary
This method processes the collection in parallel and adds the results to a ConcurrentDictionary
by invoking the provided callback for each group of items with the same key.
Example:
ParallelProcessKeys
This method processes the keys of the collection in parallel and invokes the provided callback for each key.
Example:
ParallelProcessKeysToBag
This method processes the keys of the collection in parallel and adds the results to a ConcurrentBag
by invoking the provided callback for each key.
Example:
ParallelProcessKeysToDictionary
This method processes the keys of the collection in parallel and adds the results to a ConcurrentDictionary
by invoking the provided callback for each key.
Example:
ParallelToNewSingleProcessor
This method processes the keys of the collection in parallel and returns a new SingleProcessor
instance containing the results.
Example:
ParallelToNewGroupedProcessor
This method processes the keys of the collection in parallel and returns a new GroupProcessor
instance containing the results, grouped by the provided expression.
Example:
AllKeys
Returns all keys in the processor as an enumerable.
Example:
Last updated