Skip to content

quic/stream/iter: Is QuicStream writer general enough for a base class? #66508

Description

@martenrichter

I am currently trying to convert my http2 webtransport capsule code to match a subset of QuicStream interface.

Currently, I am looking at getWriter and I am wondering, if most of this implementation is generell enough for a base stream/iter class . (Excuse my C++ jargon) .

I have just copied it over and I do not see so many places, where I have to change a thing.
So I wonder, if this should be moved to a separete place to be reusuable? (Of course the reader part may be a similar thing, but I have started with the writer).

@jasnell @pimterry What do you think?
And is it planed to have a stream/iter npm package to be used e.g. for the browser? (I like use there stream/iter as well).

Activity

  1. jasnell commented on Oct 4, 2026

    @jasnell
    Member

    It's absolutely worth generalizing. I hadn't done so yet while developing but it's been on the todo list

  2. martenrichter commented on Oct 4, 2026

    @martenrichter
    ContributorAuthor

    Ok, then I will stop working on the copy of getWriter and I will instead try to generalize it. (I hope you do not mind).
    I think it is basically a comparable amount of work.

    The first idea would be a function getWriter with an object with some callbacks, which are the implementation of the writer.

    Do you have a tip regarding the primordials ? Does somewhere a polyfill/ponyfill exists, so that I can write the code once and reuse it also outside node.js?

  3. added 3 commits that reference this issue on Oct 4, 2026
    40db343
    69719cd
    9201ffe
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions