Re: [whatwg/streams] Refactor TransformStream's backpressure handling (#571)

isonmad commented on this pull request.



>  
-  if (transformStream._readableBackpressure !== backpressure) {
-    TransformStreamSetBackpressure(transformStream, backpressure);
+  if (maybeBackpressure === true && transformStream._backpressure === false) {
+    // This allows pull() again. When desiredSize is 0, it's possible that a pull() will happen immediately (but
+    // asynchronously) after this because of pending read()s and set _backpressure back to false.
+    //
+    // If pull() could be called from inside enqueue(), then this logic would be wrong. This cannot happen
+    // because there is always a promise pending from start() or pull() when _backpressure is false.

Okay, with these two lines now I finally understand what you were worried about this entire time. I really had no idea what you were talking about.

-- 
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/571#pullrequestreview-6261802

Received on Friday, 28 October 2016 15:16:24 UTC