wabbitzzz

wabbitzzz =========

wabbitzzz

Exchange

var Exchange = require('wabbitzzz').Exchange;
var exchanage = new Exchange({
        name: 'this_is_a_cool_exchange'
    });
 
exchange.publish({hi: 'you'});
 
// publish the message, but have rabbit hold it for 3 seconds first 
exchange.delayedPublish({bye: 'you'}, {delay:3000});

Queue

var Queue = require('wabbitzzz').Queue;
var queue = new Queue({
        name: 'myQueue',
        exchangeNames:['this_is_a_cool_exchange'],
    });
 
queue(function(msgack){
    console.dir(msg);
    ack(); // pass something to ack for a failure 
});

RPC Send

var rpc = require('wabbitzzz').request('method-name');
rpc(req, function(errres){
 
});

RPC Listen

var rpc = require('wabbitzzz').response('method-name');
rpc(function(errreqcb){
 
});