-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stream: always delay construct callback by a nextTick #46818
Conversation
Review requested:
|
Signed-off-by: Matteo Collina <hello@matteocollina.com> Fixes: nodejs#46765
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though jump
is a weird name...
what would you recommend? |
|
Or: try {
stream._construct(err => {
process.nextTick(onConstruct, err);
});
} catch (err) {
process.nextTick(onConstruct, err);
} |
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Just double-checking: with this change there are now three (3) process.nextTick calls involved in a construct call: constructNT -> onConstruct -> emitConstructNT. That's intentional? |
Good spot! I was able to remove one. |
Landed in 355bcbc |
This change applies the same fix as nodejs/node#46818, and the original example given in #20456 works as expected. closes #20456
This change applies the same fix as nodejs/node#46818, and the original example given in #20456 works as expected. closes #20456 (cherry picked from commit bf42467)
This change applies the same fix as nodejs/node#46818, and the original example given in #20456 works as expected. closes #20456
Fixes: #46765