parallelSettle
Runs an array of async functions with a concurrency limit, partitioning the outcomes instead of rejecting on the first failure — parallel with settle’s fulfilled/rejected split.
Takes functions (not already-created promises, unlike settle) so it controls
when each one starts: that’s what makes the concurrency limit meaningful. At most
concurrency functions run at any time; as soon as one settles, the next queued
function starts.
Available since v3.0.2
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
functions | readonly function[] | Array of functions that return promises |
concurrency | number | Maximum number of concurrent executions. `Infinity` means no cap; any other non-finite or non-positive value (`NaN`, `0`, negative) is clamped to `1` (fully sequential) rather than rejected. |
Returns
Section titled “Returns”Promise<object> — An object with fulfilled values and rejected reasons, each in input order
Examples
Section titled “Examples”Limit concurrency without one failure stopping the rest
Section titled “Limit concurrency without one failure stopping the rest”Runs at most concurrency functions at a time and partitions outcomes instead of rejecting on the first failure.
All functions succeed
Section titled “All functions succeed”Returns an empty rejected array when nothing fails.
