Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #190 from shadyvd/master
Browse files Browse the repository at this point in the history
ZMQ -> ZeroMQ
  • Loading branch information
mcollina committed Aug 6, 2018
2 parents e920a53 + c34d37c commit 651cf4e
Show file tree
Hide file tree
Showing 7 changed files with 5,367 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
@@ -1,6 +1,8 @@
language: node_js
sudo: false
node_js:
- "10"
- "8"
- "6"
- "4"
script:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -254,7 +254,7 @@ var ascoltatori = require('ascoltatori');
var settings = {
type: 'zmq',
json: false,
zmq: require("zmq"),
zmq: require("zeromq"),
port: "tcp://127.0.0.1:33333",
controlPort: "tcp://127.0.0.1:33334",
delay: 10
Expand Down
11 changes: 10 additions & 1 deletion lib/zeromq_ascoltatore.js
Expand Up @@ -30,9 +30,18 @@ var steed = require("steed")();
function ZeromqAscoltatore(opts) {
AbstractAscoltatore.call(this);

var zmqModule = null;
try {
zmqModule = require('zmq');
process.emitWarning(`The ZMQ module will NOT work on Node.js 10+. Please upgrade to ZeroMQ by running npm install`);
}
catch(err) {
// Swallow error
}

this._opts = opts || {};
this._opts.delay = this._opts.delay || 5;
this._opts.zmq = this._opts.zmq || require("zmq");
this._opts.zmq = this._opts.zmq || zmqModule || require("zeromq");

this._connectedControls = [];

Expand Down

0 comments on commit 651cf4e

Please sign in to comment.