Kevin 29b9a0c50c clean && clean html base | 4 years ago | |
---|---|---|
.. | ||
lib | 4 years ago | |
.jscs.json | 4 years ago | |
.jshintignore | 4 years ago | |
.jshintrc | 4 years ago | |
.npmignore | 4 years ago | |
.travis.yml | 4 years ago | |
CHANGELOG.md | 4 years ago | |
CONTRIBUTION.md | 4 years ago | |
LICENSE | 4 years ago | |
Makefile | 4 years ago | |
README.md | 4 years ago | |
bower.json | 4 years ago | |
package.json | 4 years ago |
vow-queue is a module for task queue with weights and priorities
Module can be installed using npm
:
npm install vow-queue
or bower
:
bower install vow-queue
var Queue = require('vow-queue'),
queue = new Queue({ weightLimit : 10 });
queue.enqueue(function() { // simple function
return 2 * 2;
});
queue.enqueue(function() { // function returns a promise
// do job
return promise;
});
queue.enqueue( // task with custom priority and weight
function() {
// do job
},
{
priority : 3, // this task will be started before the previous two
weight : 5
});
queue.start(); // starts tasks processing
queue.enqueue(function() { }); // and enqueue yet another task