amino-driver-amqp

AMQP driver for amino

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

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(ordernext) {
  makeSprocket(order, function(errsprocket) {
    if (sprocket) {
      console.log('Created sprocket with id ' + sprocket.id);
    }
    next(err);
  });
});