zmq-xpub-xsub
Advanced tools
Comparing version 0.3.3 to 0.3.4
{ | ||
"name": "zmq-xpub-xsub", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "Central hub for ZeroMQ", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -53,5 +53,11 @@ # zmq-xpub-xsub | ||
const options = { | ||
baseAddress: 'tcp://127.0.0.1', | ||
xSubPort: 8000, | ||
xPubPort: 8001 | ||
} | ||
// Subscriber | ||
const subscriber = zmq.socket('sub'); | ||
subscriber.connect('xpub-address'); | ||
subscriber.connect(`${options.baseAddress}:${options.xPubPort}`); | ||
@@ -64,3 +70,3 @@ subscriber.on('message', (key, message) => { | ||
const publisher = zmq.socket('pub'); | ||
publisher.connect('xsub-address'); | ||
publisher.connect(`${options.baseAddress}:${options.xSubPort}`); | ||
@@ -67,0 +73,0 @@ publisher.send(['key', 'message']) |
4999
74