poppin

0.0.3 • Public • Published

poppin

A redis based queue for async background jobs. Queue/unqueue jobs onto the queue and it will emit command that you can then take care of. A command is basically an JSON with {name: COMMAND_NAME, options: ANY}. You can spawn multiple poppers to process jobs.

Getting Started

There are two important parts of poppin. The Pusher and the Popper.

The Pusher

var Poppin = require('poppin');
var pusher = new Poppin.Pusher();
pusher.createCommand('createStory', { storyName: 'Jack and Jill' });

The Popper

And if you are running the Popper. They will be sent a command and you have to take care of it by doing:

var Poppin = require('poppin');
var popper = new Poppin.Popper();
popper.on('command', function(command) {
  console.log(command.name);   // 'createStory'
  console.log(command.options) // {'storyName': 'Jack and Jill'}
});
popper.run();

/poppin/

    Package Sidebar

    Install

    npm i poppin

    Weekly Downloads

    4

    Version

    0.0.3

    License

    none

    Last publish

    Collaborators

    • westoque