1.2.0 • Published 8 years ago

rabbitmq-rpc-eventemitter v1.2.0

Weekly downloads
11
License
MIT
Repository
github
Last release
8 years ago

rabbitmq-rpc-eventemitter

Simplified rabbitmq RPC using rabbitmq-eventemitter version 1.3.1 and above.

npm install rabbitmq-rpc-eventemitter

Usage

The constructor accepts an rabbitmq-eventemitter object. The returned instance exposes a pull method for receiving and a push method for sending requests.

var queue = require('rabbitmq-eventemitter')('amqp://localhost');
var rpc = require('rabbitmq-rpc-eventemitter')(queue);

rpc.pull('get.instance', function(message, callback) {
	console.log(message); // prints { request: 1 }
	callback(null, { response: 1 });
});

rpc.push('get.instance', { request: 1 }, function(err, message) {
	console.log(message); // prints { response: 1 }
});
1.2.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago