Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2022-09-29 21:55:17 +0300
committerLuigi Pinca <luigipinca@gmail.com>2022-11-05 21:53:13 +0300
commit8dd635eb41ff05162b4851026a5a68a3360e5bbf (patch)
tree57671998400fbd8d1ca8912ce90183d4027446d9
parent60de1476eadfb83e23177a9d5135897661e957f7 (diff)
lib: use process.nextTick() instead of setImmediate()
Do not delay the call to `stream.end()` too much. PR-URL: https://github.com/nodejs/node/pull/42340 Refs: https://github.com/nodejs/node/pull/42340#issuecomment-1261163284 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>
-rw-r--r--lib/internal/js_stream_socket.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/js_stream_socket.js b/lib/internal/js_stream_socket.js
index f2a0ecaa1d8..f1efa1f807c 100644
--- a/lib/internal/js_stream_socket.js
+++ b/lib/internal/js_stream_socket.js
@@ -141,7 +141,7 @@ class JSStreamSocket extends Socket {
const handle = this._handle;
- setImmediate(() => {
+ process.nextTick(() => {
// Ensure that write is dispatched asynchronously.
this.stream.end(() => {
this.finishShutdown(handle, 0);