JSPM

  • Created
  • Published
  • Downloads 2717
  • Score
    100M100P100Q108647F

Bindings for node.js to zeromq

Package Exports

  • zmq

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (zmq) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status

node-zeromq

ØMQ bindings for node.js.

Installation

Install zmq package first.

$ npm install zmq

Example

producer.js:

var zmq = require('zmq')
  , sock = zmq.socket('push');

sock.bindSync('tcp://127.0.0.1:3000');
console.log('Producer bound to port 3000');

setInterval(function(){
  console.log('sending work');
  sock.send('some work');
}, 500);

worker.js:

var zmq = require('zmq')
  , sock = zmq.socket('pull');

sock.connect('tcp://127.0.0.1:3000');
console.log('Worker connected to port 3000');

sock.on('message', function(msg){
  console.log('work: %s', msg.toString());
});

Running tests

Install dev deps:

 $ npm install

Build:

 $ make

Test:

 $ make test