mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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>
This commit is contained in:
parent
60de1476ea
commit
8dd635eb41
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user