Skip to content

doc: stream state after unpipe is undocumented #4812

Description

@ronkorving

The documentation doesn't mention whether unpipe leaves the stream in flowing mode, or whether a manual resume is needed. If it could mention that, I think that would be helpful. It would also be good to clarify under which circumstances (eg: always vs. when the last pipe has been removed vs. as-long-as-there-are-data-listeners etc...).

Activity

  1. added
    docIssues and PRs related to Node.js documentation.
    streamIssues and PRs related to Node.js streams.
    on Jan 22, 2016
  2. added
    docIssues and PRs related to Node.js documentation.
    and removed
    docIssues and PRs related to Node.js documentation.
    on Dec 1, 2016
  3. Trott commented on May 27, 2017

    @Trott
    Member

    @ronkorving @nodejs/documentation Does this material in the docs adequately address this?

    The Readable can switch back to paused mode using one of the following:

    • If there are no pipe destinations, by calling the stream.pause() method.
    • If there are pipe destinations, by removing any 'data' event handlers, and removing all pipe destinations by calling the stream.unpipe() method.
  4. Trott commented on May 27, 2017

    @Trott
    Member

    Oh, there's this too. Not sure this addresses the issue here or not. Does it?

    Calling readable.pause(), readable.unpipe(), or receiving "back pressure" will cause the readable._readableState.flowing to be set as false, temporarily halting the flowing of events but not halting the generation of data.

  5. Trott commented on Aug 13, 2017

    @Trott
    Member

    This issue has been inactive for sufficiently long that it seems like perhaps it should be closed. Feel free to re-open (or leave a comment requesting that it be re-opened) if you disagree. I'm just tidying up and not acting on a super-strong opinion or anything like that.

  6. ronkorving commented on Aug 16, 2017

    @ronkorving
    ContributorAuthor

    From your quotes, I think the docs are probably quite a bit better now. I'm happy 👍

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

    docIssues and PRs related to Node.js documentation.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