Skip to content

Commit 7435284

Browse files
lpincaRafaelGSS
authored andcommitted
lib: use process.nextTick() instead of setImmediate()
Do not delay the call to `stream.end()` too much. PR-URL: #42340 Refs: #42340 (comment) Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 43db0fb commit 7435284

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/js_stream_socket.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class JSStreamSocket extends Socket {
141141

142142
const handle = this._handle;
143143

144-
setImmediate(() => {
144+
process.nextTick(() => {
145145
// Ensure that write is dispatched asynchronously.
146146
this.stream.end(() => {
147147
this.finishShutdown(handle, 0);

0 commit comments

Comments
 (0)