From c2acd84f4c01a125ae5709d0a5dba372c8742b61 Mon Sep 17 00:00:00 2001 From: roblabla Date: Sun, 26 Apr 2015 13:43:56 +0000 Subject: [PATCH] Revert "Let's use process.nextTick to avoid multiple gigs of ram usage :D" This reverts commit 4601abb3332c427fce58ef0241bda41bb44ae8e5. --- src/client.js | 2 +- src/protocol.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.js b/src/client.js index 24131b6..d990f01 100644 --- a/src/client.js +++ b/src/client.js @@ -108,7 +108,7 @@ Client.prototype.setSocket = function(socket) { incomingBuffer = incomingBuffer.slice(packetLengthField.size + packetLengthField.value); if (self.compressionThreshold == -2) { - process.nextTick(afterParse.bind(null, null, parsePacketData(buf, self.state, self.isServer, self.packetsToParse))); + setImmediate(afterParse, null, parsePacketData(buf, self.state, self.isServer, self.packetsToParse)); } else { parseNewStylePacket(buf, self.state, self.isServer, self.packetsToParse, afterParse); } diff --git a/src/protocol.js b/src/protocol.js index f6d3418..33c8c35 100644 --- a/src/protocol.js +++ b/src/protocol.js @@ -1626,7 +1626,7 @@ function parseNewStylePacket(buffer, state, isServer, packetsToParse, cb) { } }); } else { - process.nextTick(cb.bind(null, null, parsePacketData(buf, state, isServer, packetsToParse))); + setImmediate(cb, null, parsePacketData(buf, state, isServer, packetsToParse)); } }