Re: [streams] Byte stream update, including reference implementation (#361)

> +  controller._insideUnderlyingByteSource = false;
> +}
> +
> +function CallPullOrPullIntoLaterIfNeeded(controller) {
> +  if (controller._insideUnderlyingByteSource) {
> +    controller._callPullOrPullIntoLaterIfNeeded = true;
> +    return;
> +  }
> +
> +  Promise.resolve().then(CallPullOrPullIntoRepeatedlyIfNeeded.bind(undefined, controller));
> +}
> +
> +function CallPullOrPullIntoRepeatedlyIfNeeded(controller) {
> +  const stream = controller._controlledReadableByteStream;
> +
> +  while (true) {

We can also choose to enqueue tasks to do that instead of while loop. But I just tried to repeat it synchronously for performance.

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

Received on Wednesday, 1 July 2015 09:49:26 UTC