ProcessGroup<O, I> constructor

ProcessGroup<O, I>({
  1. required Future<O> processLoop(
    1. I
    ),
  2. int? processCount,
})

Create a ProcessGroup

Args

  • processLoop: the function that is used to process data sent to the ProcessGroup

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;
}