Re: [whatwg/streams] What should we call ReadableByteStream.prototype.getBYOBReader()? (#294)

> I thought that if we rename ReadableStreamBYOBController, the underlying source option should also be renamed as it's an option telling what type of controller it needs or what set of reading operations the stream should expose.

Hmm, I see. I think the real question is: do we expect a 1:1:1 underlying source types <-> controller types <-> reader types. I guess we should not necessarily expect that. Right now we have 1:1 underlying source types <-> controller types, and that will probably stay forever. But the correspondence with reader types is already not 1:1 since you can get both default and byob readers from (what is currently called) a ReadableStreamBYOBController.

So, OK. We should reflect this asymmetry in the API. New plan:

- Merge getBYOBReader into getReader using `{ mode: "byob" }` as an argument
- Rename ReadableStreamBYOBController to ReadableByteStreamController
- Change the `byob: true` switch to `type: "bytes"`

(Maybe there is a better word than `type`, but I thought it was important to have different terms, so we could say that a given _type_ of controller/stream/underlying source can have different _modes_ for reading from it.)

---
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/294#issuecomment-206030621

Received on Tuesday, 5 April 2016 23:22:04 UTC