🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

amqp-jobs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amqp-jobs

Minimalist abstraction layer for amqp jobs implementations

1.0.0
latest
Source
npm
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

amqp-pubsub

Minimalist abstraction layer for amqp jobs implementations.

Installation

npm install amqp-jobs

Usage

Queue work items


var amqp = require('amqp');
var jobs = require('../');

var connection = amqp.createConnection({ host: "localhost" });

connection.on('ready', function() {
  var job = jobs(connection, 'amqp-jobs-example');

  job.queue({ text : 'hello world' });
});

Worker


var amqp = require('amqp');
var jobs = require('../');

var connection = amqp.createConnection({ host: "localhost" });

connection.on('ready', function() {
  var job = jobs(connection, 'amqp-jobs-example');

  var generateError = false;

  job.worker(function(message, next) {
    // Do the work. Call next without err to acknowledge msg or pass an error do not acknowledge message
    next();
  });
});

FAQs

Package last updated on 04 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts