mr-wolf
Distributed work-queue for nodejs
Installation
$ npm install mr-wolf
Usage
Create a job
Place your work in the default /jobs-directory. Note that you can change the location of this directory using
mrWolf;
example: /jobs/sendEmail.js
moduleexports = //A job must implement the receive-method that takes two parameters //meta : the meta-data sent to the job //callback : a callback with one parameter : error (if any) { ; };
Enqueue a work-item
var mrWolf = ;//Push takes two arguments, //the job-name (should be equivalent to the fileName mentioned in create a job)//and the meta-data, which will also be supplied to the job.mrWolf;
Start working
Note that starting mr-wolf on many servers lets them share the work-load and process the queue faster.
Here's how you get start it up:
mrWolfstart //Add some listeners (optional) { } { } { } { };