ProcessGroup<O, I> constructor
Create a ProcessGroup
Args
processLoop
: the function that is used to process data sent to theProcessGroup
Notes
-
This is primarily for when you have high volume work, note that all outputs are streamed together.
-
processCount
defaults to the number of processors your device has.
Implementation
ProcessGroup({
required Future<O> Function(I) processLoop,
int? processCount,
}) {
_activeProcCount = processCount ?? Platform.numberOfProcessors;
for (var i = 0; i < _activeProcCount; i++) {
_procGroup.add(Process<O, I>(processLoop: processLoop));
}
iType = I;
oType = O;
}