-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Byte streams: write up design rationales and vision for how they are used/what they enable #177
Comments
Updated domenic's first comment to use as a task list. |
I started on this a bit by documenting some recently-discovered constraints in Requirements.md, although it was pretty quick and not too comprehensive. |
I'd like to prototype the unified byte stream underlying source idea we discussed today.
|
I wonder if we should have the stream implementation enforce the type as Uint8Array.
Alternately, we could just fill up view as much as possible, and have the returned ArrayBufferView be of a shorter byteLength. Just like if read(2) returns a smaller number of bytes than were passed in. The more interesting case is: if [[queue]] is not empty, but its first chunk is of a larger size than Agreed with everything else. Good detailed analysis. It's interesting how much shared infrastructure there will be between ReadableByteStream and ReadableStream. I wonder if ReadableByteStream does end up just being a subclass after all. Hmm. |
Added to #300.
Sounds good. Added to #300.
This makes sense for the non-BYOB reader if we add a size-limiting parameter to its 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? |
Sorry for the delay on replying to this. It slipped off my to-do list somehow.
I think we should be able to free the consumed region. Even in JavaScript you could ArrayBuffer.transfer to a smaller buffer which would let the GC collect the consumed part. |
This seems to be pretty well taken care of in the latest spec, with good examples and interop. |
A few things I can think of worth including:
The text was updated successfully, but these errors were encountered: