Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 7c732f4aca
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (23 sloc) 0.694 kb

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();
});
Jump to Line
Something went wrong with that request. Please try again.