p-iteration icon indicating copy to clipboard operation
p-iteration copied to clipboard

Add mapParallel and forEachParallel

Open tracker1 opened this issue 7 years ago • 1 comments

Would be nice to see a forEach that allowed for parallel execution..

  • mapParallel(array, options, callback, [thisArg])
  • forEachParallel(array, options, callback, [thisArg])

options

  • concurrency: number, min: 1, max: ????
    • The number of in-flight/unresolved concurrent operations to start.

tracker1 avatar Jun 21 '17 07:06 tracker1

map and forEach are already run concurrently.

Certainly a concurrency parameter would be nice, but I want to keep the main methods with the same API as the original ES5 ones.

Adding forEachLimit, mapLimit, etc. could be the way to go. Similar to the async library xxxLimit methods.

toniov avatar Jun 21 '17 07:06 toniov