Re: [streams] Transform streams and acknowledgement of writes (#329)

> If there is a writer that takes a function which will be called with a buffer provided via BYOB reader, it will work well with BYOB reader (But I think it is a bad idea).

In the `operationStream` branch, I prototyped similar one. With some modification, that would be,

1. obtain a writer. `writer.beginWrite()` returns a promise which will be fulfilled with an ArrayBufferView representing a memory region to which the producer should write data
1. the producer writes bytes into the region
1. the producer notifies that it finished writing by calling `writer.done(view)` where `view` is backed by the same ArrayBuffer as one returned by `writer.beginWriter()` (possibly ArrayBuffer.transfer()-ed) but pointing at a region to which the producer has written generated bytes.

This also works well with BYOB-style reader side. The returned `view` will be returned through the BYOB interface.

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

Received on Friday, 29 May 2015 06:39:30 UTC