@shumoku/core · 0.4.0 · function
mapWithConcurrency
APIの説明は英語のcanonical sourceを表示しています。
Run `fn` over `items` with at most `limit` calls in flight at once, preserving input order in the result array. Replaces the two failure modes the audit found: unbounded `Promise.all` fan-out (network-scan would open hundreds of SNMP sockets at once) and fully sequential `await`-in-a-loop polling (zabbix walked hosts one by one). A rejected `fn` rejects the whole call (like `Promise.all`); a caller wanting partial results should catch inside `fn`.
mapWithConcurrency(items: readonly T[], limit: number, fn: object): Promise<R[]> パラメーター
| 名前 | 型 | 説明 | 既定値 |
|---|---|---|---|
items | readonly T[] | 追加説明はありません。 | — |
limit | number | 追加説明はありません。 | — |
fn | object | 追加説明はありません。 | — |
戻り値
Promise<R[]>