payapi-rabbus
Version:
A micro-servicebus for RabbitMQ. Forked from https://github.com/derickbailey/rabbus.git solely to make it use payapi-whistlepunk as a dependency.
33 lines (26 loc) • 581 B
JavaScript
var util = require("util");
var rabbot = require("payapi-rabbot");
var config = require("../rabbus/specs/config");
function connect(cb){
rabbot
.configure({ connection: config })
.then(cb)
.catch(function(err){
setImmediate(function(){ throw err; });
});
}
process.once("SIGINT", function(){
exit();
});
process.on("unhandledException", function(err){
console.log(err);
exit();
});
function exit(){
console.log("");
console.log("shutting down ...");
rabbot.closeAll().then(function(){
process.exit();
});
}
module.exports = connect;