install gulp
This commit is contained in:
+49
@@ -0,0 +1,49 @@
|
||||
vow-queue [](http://badge.fury.io/js/vow-queue) [](http://travis-ci.org/dfilatov/vow-queue)
|
||||
===============
|
||||
|
||||
vow-queue is a module for task queue with weights and priorities
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Module can be installed using `npm`:
|
||||
|
||||
```
|
||||
npm install vow-queue
|
||||
```
|
||||
|
||||
or `bower`:
|
||||
|
||||
```
|
||||
bower install vow-queue
|
||||
```
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
````javascript
|
||||
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
|
||||
````
|
||||
Reference in New Issue
Block a user