1.0.0 • Published 9 years ago
promise-concurrent v1.0.0
promise-concurrent
Execute a list of promises with a limited concurrency
Install
$ npm install --save promise-concurrent
Usage
const promiseConcurrent = require('promise-concurrent');
const got = require('got');
const endpoints = [
got.bind(got, 'todomvc.com'),
got.bind(got, 'yeoman.io'),
got.bind(got, 'ava.li')
];
promiseConcurrent(endpoints, 1).then(result => {
console.log(result);
//=> array of response objects
});
API
promiseConcurrent(promises, concurrency)
promises
Type: function[]
Array of functions that return a promise.
concurrency
Type: number
Default: 0
Number of concurrent executions. 0
means maximum concurrency.
License
MIT © Sam Verschueren
1.0.0
9 years ago