amino-driver-amqp

AMQP driver for amino

npm install amino-driver-amqp
2 downloads in the last week
2 downloads in the last month

amino-queue-amqp allows you to use an AMQP server (such as RabbitMQ as a queue backend for amino.

Usage

order-sprocket.js

// Add sprocket request to a queue. These things take time.
var amino = require('amino')
  .use(require('amino-queue-amqp'), {url: 'amqp://my-server'});

amino.queue('orders', {type: 'sprocket-b', spokes: 5});
console.log('Your order is processing!');

make-sprockets.js

// Fulfill sprocket requests.
var amino = require('amino')
  .use(require('amino-queue-amqp'), {url: 'amqp://my-server'});

amino.process('orders', function(order, next) {
  makeSprocket(order, function(err, sprocket) {
    if (sprocket) {
      console.log('Created sprocket with id ' + sprocket.id);
    }
    next(err);
  });
});
npm loves you