my-idlers/node_modules/ext/docs/promise/limit.md
cp6 fd22b0bf58 V2 (Laravel re-make)
V2 (Laravel re-make)
2022-03-06 02:02:12 +11:00

409 B

Promise.limit (ext/promise/limit)

Helps to limit concurrency of asynchronous operations.

const limit = require("ext/promise/limit").bind(Promise);

const limittedAsyncFunction = limit(2, asyncFunction);

imittedAsyncFunction(); // Async operation started
imittedAsyncFunction(); // Async operation started
imittedAsyncFunction(); // On hold until one of previously started finalizes