Repository navigation
http: OutgoingMessage is missing _writableState #20946
Description
Activity
- changed the title
[-]IncomingMessage is missing _writableState[/-][+]OutgoingMessage is missing _writableState[/+]on May 24, 2018 - changed the title
[-]OutgoingMessage is missing _writableState[/-][+]http: OutgoingMessage is missing _writableState[/+]on May 24, 2018 Please keep in mind that both
_readableStateand_writeableStateare internal properties and you shouldn't use or rely on them in any way. There has been quite a bit of heavy refactoring on master regarding the two, and I won't be surprised if they started disappearing from places./cc @nodejs/streams @mcollina @mafintosh
- addedstreamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
on May 25, 2018 Please keep in mind that both _readableState and _writeableState are internal properties and you shouldn't use or rely on them in any way.
I am aware of this. However, a lot of popular packages seem to make assumptions in regards to this. I remember this being discussed a long time ago, just not sure what the consensus was. I believe these were going to be made public?
I do not have a paper trail, it's buried in our issue tracker. The gist is that
OutgoingMessageis not aWritable, it just quacks like one. The main reason for this is performance: if we made it a full writable we would lose a significant amount of throughput.OutgoingMessagedoes not buffer any data internally, it just forwards it to the underlining stream as fast as it can.The overall plan is to remove the use of
_readableStateand_writableStateacross core codebase: #445. We are doing this by creating accessors. Ideally those accessors could be added toOutgoingMessage, so that they can have the same interface and guarantees.Reacted by Robert Nagy, Nick K. and isaymeI think this issue can be closed. Feel free to open new issues for missing accessor/etc in
OutgoingMessage.Reacted by Robert Nagy
OutgoingMessageis missing_writableState. More of a consistency issue. Not sure what the current plan is in regards to_readableStateand_writableState. However, some user land modules seem to assume they exists.