amino-driver-amqp
v0.2.0
Published
AMQP driver for amino
Downloads
1
Readme
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);
});
});