Natural Preference for Minification
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

fake-queue

1.0.3 • Public • Published

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();
});

Keywords

none

install

npm i fake-queue

Downloadsweekly downloads

18

version

1.0.3

license

none

repository

githubgithub

last publish

collaborators

  • avatar