poolSize property

int get poolSize

One core is left for the UI; a device with one or two still gets a worker, because work off the event loop is preempted by the OS instead of stalling every frame until it finishes.

Implementation

int get poolSize {
  if (cores < 1) {
    throw ArgumentError.value(cores, 'cores', 'a device has at least one');
  }
  final int spare = cores - 1;
  if (spare < 1) return 1;
  return spare > ceiling ? ceiling : spare;
}