Simple in-memory queue for Node.js
JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 2 commits behind pgte:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
index.js
package.json
test.js

README.md

fake-queue

In-memory queue for Node.js.

Used initially for simulating a queueing system for testing banzai.

Installation

$ cd <PROJECT ROOT>
$ npm install fake-queue

Usage

Job producer:

var queue  = require('fake-queue')();

var job = {
    to: 'pedro.teixeira@gmail.com'
  , subject: 'Oh hay!'
  , body: 'Hello world!'
};

queue.push('email', job);

Job consumer:

var queue = require('fake-queue)();

queue.pop('email', function(job, done) {
  // actually send the email (not done here);

  // call done, with no error, or done(err) if there is an error
  done();
});