Run tasks with at most limit executing concurrently, preserving input
order in the returned results.
When options.shouldStop is supplied it is evaluated by each worker before it
claims its next task; once it returns true no further tasks are dispatched
(in-flight tasks still complete) and their slots stay undefined.
Run
taskswith at mostlimitexecuting concurrently, preserving input order in the returned results.When
options.shouldStopis supplied it is evaluated by each worker before it claims its next task; once it returnstrueno further tasks are dispatched (in-flight tasks still complete) and their slots stayundefined.