heroku-bus-client
v0.0.5
Published
Client for simple MQ Broker at Heroku
Downloads
3
Readme
Heroku bus client
Node.JS client for Heroku Bus server (https://github.com/YaroslavGaponov/heroku-bus-server)
Example
Publisher
var Client = require('heroku-bus-client');
var publisher = new Client('http://stormy-gorge-8934.herokuapp.com');
publisher.send('topic', 'test', { "time": Date(), 'message': process.argv[2] || 'Hello from Ukraine!!!' });
Subscriber
var Client = require('heroku-bus-client');
var subscriber = new Client('http://stormy-gorge-8934.herokuapp.com');
subscriber.subscribe('topic', 'test');
subscriber.on('message', function(message) {
console.log(message);
});
subscriber.on('error', function(error) {
console.log(error);
});