-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
[x] stream: eos avoid listeners when possible #28751
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
Conversation
fe38aea
to
bd553ab
Compare
ping @benjamingr |
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.
Would you mind adding a unit test?
9482e59
to
176ef57
Compare
@mcollina: Not sure I understand what to unit test here? Shouldn't existing unit tests already cover this? It's just an optimisation. Shouldn't be behavioural change. |
You can test that those listeners are not added in that case. |
@mcollina As far as I can see there are no tests for end-of-stream whatsoever? Or am I missing something? |
the tests are in test-stream-finished.js |
This is still waiting on the addition of the tests. |
176ef57
to
e9655f8
Compare
@jasnell: rebased, added test and added a few more conditions |
7d65c09
to
aefa28d
Compare
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.
I'm flagging it semver-major out of caution, this is supposed to work with users streams as well.
Any particular concern I can try to address? |
A review from @mafintosh would help. |
aefa28d
to
f4b5ddb
Compare
f4b5ddb
to
edb7e47
Compare
I'm putting this on ice for now. Will re-open later. |
This slightly improves performance and maintainability by applying legacy compat logic only when required.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes