mapParallel<U> method
Operates like Iterable.map except performs the function mapper
on a
background isolate. parallel
denotes how many background isolates to use
(so it must be a positive number).
This is only useful if the computation time of mapper
out paces the
overhead in coordination.
If preserving the order of the iterable
is not required,
the preserveOrder
setting can be set to false
, reducing memory and
returning results as soon as available.
Note: mapper
must be a static method or a top-level function.
Implementation
Stream<U> mapParallel<U>(
U Function(T input) mapper, {
int parallel = 1,
bool preserveOrder = true,
}) =>
pmap(
this,
mapper,
parallel: parallel,
preserveOrder: preserveOrder,
);