Skip to content

http: OutgoingMessage is missing _writableState #20946

Description

@ronag

OutgoingMessage is missing _writableState. More of a consistency issue. Not sure what the current plan is in regards to _readableState and _writableState. However, some user land modules seem to assume they exists.

Activity

  1. changed the title [-]IncomingMessage is missing _writableState[/-] [+]OutgoingMessage is missing _writableState[/+] on May 24, 2018
  2. changed the title [-]OutgoingMessage is missing _writableState[/-] [+]http: OutgoingMessage is missing _writableState[/+] on May 24, 2018
  3. ryzokuken commented on May 25, 2018

    @ryzokuken
    Contributor

    Please keep in mind that both _readableState and _writeableState are 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.

  4. ryzokuken commented on May 25, 2018

    @ryzokuken
    Contributor

    /cc @nodejs/streams @mcollina @mafintosh

  5. added
    streamIssues and PRs related to Node.js streams.
    on May 25, 2018
  6. ronag commented on May 25, 2018

    @ronag
    MemberAuthor

    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?

  7. mcollina commented on May 25, 2018

    @mcollina
    SponsorMember

    I do not have a paper trail, it's buried in our issue tracker. The gist is that OutgoingMessage is not a Writable, 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. OutgoingMessage does 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 _readableState and _writableState across core codebase: #445. We are doing this by creating accessors. Ideally those accessors could be added to OutgoingMessage, so that they can have the same interface and guarantees.

  8. ronag commented on Jul 14, 2019

    @ronag
    MemberAuthor
  9. mcollina commented on Jul 16, 2019

    @mcollina
    SponsorMember

    I think this issue can be closed. Feel free to open new issues for missing accessor/etc in OutgoingMessage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    streamIssues and PRs related to Node.js streams.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions