add NodeJS example

This commit is contained in:
Willyb321 authored and William Blythe committed 2017-04-16 15:04:55 +10:00
1 parent dd4ea46bc8
commit 4cde5e3f8b
4 files changed
+328

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
const zlib = require('zlib');
const zmq = require('zeromq');
const sock = zmq.socket('sub');
sock.connect('tcp://eddn-relay.elite-markets.net:9500');
console.log('Worker connected to port 9500');
sock.subscribe('');
sock.on('message', topic => {
console.log(JSON.parse(zlib.inflateSync(topic)));
});