Skip to content

josudoey/message4nsq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

message4nsq

NPM Build Status Test Coverage Code Climate Issue Count

Installation

$ npm install --save message4nsq

Example

var bluebird = require('bluebird');
var message = require('message4nsq')({
  'nsqdTCPAddresses': 'localhost:4150',
  promisify: bluebird.promisify
});
var topic = 'devTopic';
var channel = 'devChannel';
var msg = {
  foo: 'bar'
};

message.publish(topic, msg, function (err) {
  if (err) {
    console.log(err);
    return;
  }
  console.log('message sent.');
  message.close();
});

var reader = message.watch(topic, channel, function (msg) {
  console.log('message recv: ' + JSON.stringify(msg.json()));
  msg.finish();
});

About

provide a simple nsq interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published