1.0.0 • Published 8 years ago

promise-concurrent v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

promise-concurrent Build Status

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