lyxaira.glass 74ca844f42 Actualizacion cambios generados: seccion #12, #14 y #15. | 4 yıl önce | |
---|---|---|
.. | ||
node_modules/p-try | 4 yıl önce | |
index.js | 4 yıl önce | |
license | 4 yıl önce | |
package.json | 4 yıl önce | |
readme.md | 4 yıl önce |
Run multiple promise-returning & async functions with limited concurrency
$ npm install p-limit
const pLimit = require('p-limit');
const limit = pLimit(1);
const input = [
limit(() => fetchSomething('foo')),
limit(() => fetchSomething('bar')),
limit(() => doSomething())
];
(async () => {
// Only one promise is run at once
const result = await Promise.all(input);
console.log(result);
})();
Returns a limit
function.
Type: number
Minimum: 1
Concurrency limit.
Returns the promise returned by calling fn
.
Type: Function
Promise-returning/async function.
MIT © Sindre Sorhus