Skip to content

Commit 9ccf8b2

Browse files
lpincadanielleadams
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 <targos@protonmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent facb606 commit 9ccf8b2

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)