[whatwg/streams] Support teeing readable byte streams (#1114)

With this PR, teeing a readable byte stream will now create two *readable byte streams* (instead of two "default" readable streams). See #1111 for context.

This implements the "hard" solution: when a branch is being read using a BYOB reader, the view of that read request is forwarded to the original stream, so it can read directly into that view. After the view is filled, an identical copy is created and enqueued on the other branch, so they both see the same data.

---

- [ ] At least two implementers are interested (and none opposed):
   * …
   * …
- [ ] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * …
- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chrome: …
   * Firefox: …
   * Safari: …

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)

You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/streams/pull/1114


-- Commit Summary --

  * Bring back CreateReadableByteStream
  * Unexport CreateReadableByteStream
  * Implement CreateReadableByteStream
  * Make a copy of ReadableStreamTee
  * Add ReadableByteStreamTee
  * Extract ReadableByteStreamControllerGetBYOBRequest abstract op
  * Allow passing a smaller view to BYOBRequest.respondWithNewView
  * Read into BYOB request in ReadableByteStreamTee

-- File Changes --

    M index.bs (23)
    M reference-implementation/lib/ReadableByteStreamController-impl.js (16)
    M reference-implementation/lib/abstract-ops/readable-streams.js (317)

-- Patch Links --

https://github.com/whatwg/streams/pull/1114.patch

https://github.com/whatwg/streams/pull/1114.diff


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1114

Received on Saturday, 20 March 2021 00:52:34 UTC