/pmap

Parallel map function for Dart

Primary LanguageDartBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

pmap

Description

A parallel implementation of Iterable.map. This is a convenient function to help parallelize expensive operations.

Example

import 'package:pmap/pmap.dart';

int square(int x) => x * x;

void main() async {
  List<int> list = [1, 2, 3, 4, 5];
  Stream<int> results = pmap(list, square);
  await for (int value in results) {
    print(value);
  }
}