parallel
Runs an array of async functions with a concurrency limit.
At most limit functions will be running at any time.
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
functions | readonly function[] | Array of functions that return promises |
limit | number | Maximum number of concurrent executions |
Returns
Section titled “Returns”Promise<T[]> — Promise that resolves with an array of results in the same order as the input
Examples
Section titled “Examples”Run tasks with concurrency limit
Section titled “Run tasks with concurrency limit”Executes async functions with at most N running concurrently.
Sequential execution with limit of 1
Section titled “Sequential execution with limit of 1”Setting limit to 1 runs functions one at a time.
