Skip to content

Commit

Permalink
lib: use process.nextTick() instead of setImmediate()
Browse files Browse the repository at this point in the history
Do not delay the call to `stream.end()` too much.

PR-URL: nodejs#42340
Refs: nodejs#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]>
  • Loading branch information
lpinca committed Nov 5, 2022
1 parent 60de147 commit 8dd635e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/js_stream_socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8dd635e

Please sign in to comment.