Package Exports
- promise-queue
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (promise-queue) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
promise-queue
[]
(https://npmjs.org/package/promise-queue)
[
]
(https://travis-ci.org/azproduction/promise-queue)
[
]
(https://coveralls.io/r/azproduction/promise-queue)
[
]
(https://gemnasium.com/azproduction/promise-queue)
Promise-based queue
Installation
promise-queue
can be installed using npm
:
npm install promise-queue
Example
Queue.configure(function () {
return $.Deferred() || require('vow').promise();
});
// max concurrent - 1
// max queue - Infinity
var queue = new Queue(1, Infinity);
queue.add(function () {
// resolve of this promise will resume next request
return downloadTarballFromGithub(url, file);
})
.then(function (file) {
doStuffWith(file);
});
queue.add(function () {
return downloadTarballFromGithub(url, file);
})
// This request will be paused
.then(function (file) {
doStuffWith(file);
});