Permalink
Browse files

5ms delay was being interrupted in sub 5ms run-times

  • Loading branch information...
1 parent a0c4a44 commit 764ccd92c013ebef572098dceb2555ff9a64eb3d @thesmart thesmart committed Dec 17, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/message_batch_stream.js
@@ -141,7 +141,6 @@ MessageBatchStream.prototype.deQueueBatch = function() {
*/
MessageBatchStream.prototype._start = function() {
if (!this._isPaused && !this._interval) {
- process.nextTick(this._onTick.bind(this));
this._interval = global.setInterval(this._onTick.bind(this), 5);
}
};
@@ -238,6 +237,7 @@ MessageBatchStream.prototype.end = function() {
MessageBatchStream.prototype.destroy = function() {
this.write = function() {};
this._stop();
+ this._onTick();
this.emit('close');
};

0 comments on commit 764ccd9

Please sign in to comment.