|
|
il y a 7 ans | |
|---|---|---|
| .. | ||
| lib | il y a 7 ans | |
| .jscs.json | il y a 7 ans | |
| .jshintignore | il y a 7 ans | |
| .jshintrc | il y a 7 ans | |
| .npmignore | il y a 7 ans | |
| .travis.yml | il y a 7 ans | |
| CHANGELOG.md | il y a 7 ans | |
| CONTRIBUTION.md | il y a 7 ans | |
| LICENSE | il y a 7 ans | |
| Makefile | il y a 7 ans | |
| README.md | il y a 7 ans | |
| bower.json | il y a 7 ans | |
| package.json | il y a 7 ans | |

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