Re: [whatwg/streams] do chunk boundaries have to be preserved through to underlying sink? (#739)

Agreed with @ricea regarding non-byte streams.

----

WritableByteStreamController may have something like coalescing/splitting that the ReadableByteStreamController has though I'm not sure what's appropriate, yet.

E.g. IdentityTransformByteStream (Identity might be misleading though) may have a ReadableByteStream at the readable side and WritableByteStream at the writable side whose writer has .beginWrite() (see https://github.com/whatwg/streams/issues/329#issuecomment-106711552) so that buffers provided to BYOB reader can be passed to the writer side as-is (but after transfer). WritableByteStream may also be able to vend a default writer which takes buffers and they are used to fill the buffer provided to the BYOB reader.

----

If we introduce writev()/cork style interface, yes, we basically want to pass them to the underlying sink as-is as @ricea said as the underlying sink may be able to do scatter-and-gather in efficient way.

If coalescing helper is worth being a part of the Streams API, we could add it. That could be e.g. in the form of .read(buffer) style API added to WritableByteStreamController though this needs diverting underlying sink API as currently we're pushing chunks to it by calling underlyingSink.write() (though with backpressure respected).


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/739#issuecomment-298319226

Received on Monday, 1 May 2017 11:05:00 UTC