You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quick question, there's probably already been a consensus on this but it looks like ReadableStreams with pull sources do not call pull until full, at least with the default controller.
IE given a high water mark of 3 chunks and a pull source a ReadableStream will only call pull once rather than three times, assuming no read requests.
I assume the internal queues are meant to act as buffers. So shouldn't a ReadableStream attempt to fill its buffer? Simple solution seems to be to get rid of the pullAgain variable and just always call callPullIfNeeded after a successful pull.
The text was updated successfully, but these errors were encountered:
Pull is called three times in your example. You can run the following code in Chrome Canary (or with the reference implementation) to confirm:
letcounter=0;constrs=newReadableStream({pull(c){c.enqueue("a");console.log(`pull called ${++counter} times`);}},{highWaterMark: 3});
This is tested in the web-platform-test general.js, "ReadableStream: should call pull after enqueueing from inside pull (with no read requests), if strategy allows".
Going to close since this doesn't appear to be an issue, but happy to continue discussing and will reopen if I missed something!
Quick question, there's probably already been a consensus on this but it looks like ReadableStreams with pull sources do not call pull until full, at least with the default controller.
IE given a high water mark of 3 chunks and a pull source a ReadableStream will only call pull once rather than three times, assuming no read requests.
I assume the internal queues are meant to act as buffers. So shouldn't a ReadableStream attempt to fill its buffer? Simple solution seems to be to get rid of the pullAgain variable and just always call callPullIfNeeded after a successful pull.
The text was updated successfully, but these errors were encountered: