stream: async iterator destroy compat#29176
Conversation
|
@mcollina is there a reason why it's not done like this instead? |
mcollina
left a comment
There was a problem hiding this comment.
I’m ok in changing the async iterator. I’m -1 in changing destroy().
The callback in destroy predates adding finished to node core.
|
|
|
The biggest issue I have with this is that it's undocumented and monkey patched
There are a few
An alternative is to make it documented and part of the public API? Also, I wouldn't mind fixing the once that are streams. |
a062e90 to
4e76538
Compare
|
The callback property was added because it was needed somewhere in core. Maybe that has changed somehow, but I would rather wait before calling it deprecated. Fixing the stream iterator thing is important anyway, good spot. |
81f38d2 to
f168368
Compare
|
Can you add a test with an overridden destroy with no callback? |
|
You might want to change the name of the PR and the commit message. |
|
Added test |
f168368 to
9b36299
Compare
|
Messages fixed |
9b36299 to
81118d4
Compare
Yep. I can see it now. Classes that inherit from streams use it sometimes. But it doesn't ever seem to be used outside of the implementation (except for the case with this PR). We might want to consider refactoring that and calling the method something else hidden behind a symbol. |
|
Created a follow up issue #29180 |
e08ccc1 to
71c4984
Compare
There was a problem hiding this comment.
Isn’t that part of another PR?
There was a problem hiding this comment.
yes, put this as blocked and wait for that first?
71c4984 to
e1290f2
Compare
async iterator should not depend on internal API for better compat with streamlike objects.
e1290f2 to
98fcb56
Compare
async iterator should not depend on internal API for better compat with streamlike objects. PR-URL: #29176 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in 4e188b3 |
async iterator should not depend on internal API for better compat with streamlike objects. PR-URL: #29176 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
destroy with callback can achieved using destroy
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes