Sitelet https://github.com/nodejs/node/issues/43487
Skip to content

Optional parameter strategy for stream.Readable.toWeb()? #43487

Description

@rauschma

What is the problem this feature will solve?

Currently, it is not possibly to customize the queueing strategy of the ReadableStream returned by stream.Readable.toWeb().

What is the feature you are proposing to solve the problem?

Change the signature from:

stream.Readable.toWeb(streamReadable: Readable): ReadableStream
stream.Readable.toWeb(streamReadable: Readable, strategy?: QueuingStrategy): ReadableStream

What alternatives have you considered?

I’m not aware of any alternatives: As far as I know, there is no way to change the queuing strategy of a ReadableStream after its constructor was invoked.

Activity

  1. Trott commented on Jun 19, 2022

    @Trott
    Member

    @nodejs/streams

  2. benjamingr commented on Jun 19, 2022

    @benjamingr
    Member

    @rauschma hey Axel, sure this is a pretty easy fix, the code is in /lib/internal/webstreams/adapters.js line 389, the code currently just does:

      const strategy =
        objectMode ?
          new CountQueuingStrategy({ highWaterMark }) :
          { highWaterMark };

    Would you be interested in contributing a fix? (Happy to guide you through)

  3. Warkanlock commented on Jun 21, 2022

    @Warkanlock
    Contributor

    I took it upon myself to make a change to include a strategy parameter in the .toWeb() method inside the Readable.js stream object.

    This would be my first PR against the Node code base, please don't be too hard on me lol.

    The tests are pending but I would love to hear how I can approach them.

  4. moved this to Pending Triage in Node.js feature requestson Oct 22, 2022
  5. github-actions commented on Dec 19, 2022

    @github-actions
    Contributor

    There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

    For more information on how the project manages feature requests, please consult the feature request management document.

  6. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Dec 19, 2022
  7. benjamingr commented on Dec 19, 2022

    @benjamingr
    Member

    This already landed 🎉

  8. moved this from Pending Triage to Stale in Node.js feature requestson Apr 4, 2023
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

    feature requestIssues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions