Re: [streams] What types does ReadableByteStream's reader's read(x) accept and return? (#295)

Awesome! I'll do a PR so I can do some line comments.

> When getByobReader() and read(view) is called, underlyingByteSource.pullInto() is called.
>
> When getReader() and read() is called, underlyingByteSource.pull() is called.

What is the motivation for having pull() at all, instead of just using pullInto()? I imagine there is one and I just forgot it. Let's be sure to write it down, either in FAQ.md or in the spec or something?

>  If byobReader.read(new Float64Array(2)) is called when:
> - ...
> When there is a pending read request of new Float64Array(2) with 0 byte filled:
> - ...

These sound pretty great. So to be clear, pullInto() always gets a Uint8Array? I like that.

> if controller.close() is called -> close the stream. as the buffer is currently owned by the underlying byte source, wait for respond() call. when respond() call happens, fulfill the pending request with the returned buffer and done of true.

This one is a big strange. I am not sure I understand the reasoning. Maybe instead we should just give the buffer back as a zero-length view?

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

Received on Thursday, 11 June 2015 20:16:42 UTC