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

@domenic commented on this pull request.



> +        if (branch2._controller._pendingPullIntos.length > 0) {
+          ReadableByteStreamControllerRespond(branch2._controller, 0);
+        }
+        resolvePromise(cancelPromise, undefined);
+      },
+      errorSteps: () => {
+        reading = false;
+      }
+    };
+    ReadableStreamDefaultReaderRead(reader, readRequest);
+  }
+
+  function pullWithBYOBReader(view, forBranch2) {
+    if (ReadableStreamDefaultReader.isImpl(reader)) {
+      assert(reader._readRequests.length === 0);
+      ReadableStreamReaderGenericRelease(reader);

Wow, so this switches off readers according to which each branch is doing? Very cool!

-- 
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#pullrequestreview-621612527

Received on Thursday, 25 March 2021 21:58:26 UTC