rabbitmq-rpc-eventemitter
Simplified rabbitmq RPC
Last updated 4 years ago by kapetan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rabbitmq-rpc-eventemitter 
SYNC missed versions from official npm registry.

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 }
});

Current Tags

  • 1.2.0                                ...           latest (4 years ago)

5 Versions

  • 1.2.0                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 5
Last Month 1
Dependencies (4)
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |