diff --git a/lib/ipc-flow-control.js b/lib/ipc-flow-control.js index 4c28372dd..89a355372 100644 --- a/lib/ipc-flow-control.js +++ b/lib/ipc-flow-control.js @@ -7,6 +7,8 @@ // minimally supported versions) we need flow control based on `send()`'s return // value. +const nowAndTimers = require('./now-and-timers'); + function controlFlow(channel) { let sending = false; @@ -32,7 +34,7 @@ function controlFlow(channel) { buffer.push(message); if (!sending) { sending = true; - setImmediate(deliverNext); + nowAndTimers.setImmediate(deliverNext); } }; }