Re: [streams] Byte streams: write up design rationales and vision for how they are used/what they enable (#177)

> I wonder if we should have the stream implementation enforce the type as Uint8Array.

Added to #300.

> Alternately, we could just fill up view as much as possible, ...

Sounds good. Added to #300.

> The more interesting case is: if [[queue]] is not empty, but its first chunk is of a larger size than view. ...

This makes sense for the non-BYOB reader if we add a size-limiting parameter to its `read()` method as you discussed last week.

For BYOB, anyway we need to append the data to the given buffer as the consumer may already have written some data in the encapsulated ArrayBuffer and expect the new data to be added right next to the data the region of which is specified by the given view.

Another point I wonder how we should deal with is, whether the partially consumed bytes in the large buffer should be considered as freed or not from backpressure point of view. If we cannot free the partially consumed region, it continues to have memory pressure. So, should we refrain from pulling?

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/177#issuecomment-84829308

Received on Monday, 23 March 2015 06:22:06 UTC