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

Commit

Permalink
only check _pause if socket type is pull
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Patzer committed Mar 17, 2015
1 parent 5d0aa8d commit 19a0b81
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,8 @@ exports.Socket = function (type) {
EventEmitter.call(this);
this.type = type;
this._zmq = new zmq.SocketBinding(defaultContext(), types[type]);
this._pause = false;
this._zmq.onReady = function() {
if (self._pause) return;

function onReady() {
try {
self._flush();
} catch (err) {
Expand All @@ -201,6 +200,17 @@ exports.Socket = function (type) {
}
}

if (this.type == 'pull') {
this._pause = false;
this._zmq.onReady = function() {
if(self._pause) return;
onReady();
}
}
else {
this._zmq.onReady = onReady;
}

this._outgoing = [];
};

Expand Down

0 comments on commit 19a0b81

Please sign in to comment.