ol-queue
v0.0.2
Published
Implementation of queue with task invoker
Downloads
3
Maintainers
Readme
Implementation of queue with task invoker
Installation
npm install --save ol-queue
Api
'use strict'
const Queue = require('ol-queue');
let job = (task) => {
task.done = true;
}
let q = new Queue(job, {
autoStart: true, //default is false
workers: 2 // default is 1
});
q.start(); // to start the queue
//push takes array or object and optional parameter
q.push({
_id: 1 // if the _id not provided the Queue will generate GUID
}, true); // optional pass true on get as return the Queue instance to allow function chaining like .push().push().start()
- Todos:
- More tests
- Extend Api usage documentation
- All the
// Todos
in the code