http,stream: remove usage of _readableState#20051
http,stream: remove usage of _readableState#20051ryzokuken wants to merge 1 commit intonodejs:masterfrom
Conversation
Remove the usage of the restricted _readableState property and use the readableFlowing property instead. Refs: nodejs#445
What do you mean by "it does not work"? Note that |
|
@mcollina I was definitely mislead to believe they behaved in similar ways by the docs. Anyway, in the case, do I have to expose a non-private |
|
I'm not necessarily certain that Exposing a new property would be fine, but this seems rather peculiar, and I truly do not know what is the right path here. |
|
@mcollina I'd definitely love to help out as much as I can, but considering the complexity of this problem and my relative lack of knowledge about how streams work internally, that might not be much. Should I close this? |
|
Yes, please. Also this area is being worked by @apapirovski in #20088. |
Remove the usage of the restricted _readableState property and use the
readableFlowing property instead.
Refs: #445
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesThis should work but doesn't. According to the original code:
Technically, it should be called whenever the stream isn't accessed.
According to the docs of
Readableat https://nodejs.org/api/stream.html#stream_readable_streams:reqmust be aReadablestream.readable.readableFlowing = nullwhen the above condition is true (Ref: https://nodejs.org/api/stream.html#stream_three_states)Therefore, substituting the above condition by
if (req.readableFlowing === null)must work.But it doesn't.
@mcollina @mafintosh @nodejs/streams any idea why?