0.0.2 • Published 8 years ago

ol-queue v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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