Re: [streams] Convert readable stream pull() to promise-returning (#272)

>      <ol>
> -      <li> Call-with-rethrow Call(<var>stream</var>@\[[error]], <b>undefined</b>, «‍<var>pullResult</var>.\[[value]]»).
> -      <li> Return <var>pullResult</var>.
> +      <li> Upon fulfillment of <var>stream</var>@\[[pullingPromise]], call-with-rethrow
> +        CallReadableStreamPull(<var>stream</var>).

I suggest a design like WritableStreamAdvanceQueue, i.e. set only one fulfillment callback on creation of pullingPromise, and in the callback, check whether CallReadableStreamPull was ever called since the last time we invoked underlyingSource.pull.

CallReadableStreamPull is invoked on any event that may cause shouldApplyBackpressure to be flipped. We shouldn't set a fulfillment callback every time when CallReadableStreamPull is called.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/272/files#r23671044

Received on Wednesday, 28 January 2015 08:09:13 UTC