Re: [streams] Add ReadableByteStream definition (#343)

OK, I guess I couldn't resist at least a high-level review.

I am a bit confused by the controller + underlying source model here. From what I can see, the idea is that pull() is called on each read, and each time it is called, you can call c.resolve(chunk) once. Is that the idea?

I thought though that ReadableByteStream was going to need an internal queue as well. Because what if someone doesn't read for a long time, and the kernel buffer starts getting full? Do we make underlying byte source implementers do their own buffering to handle that case?

Also I know we had a discussion in person which concluded that `c.resolve(chunk)` was better than `return chunk` or `return promiseForChunk`, mainly having to do with cancelation. Can you help remind me why that was important?

The `resolve` name is probably not the best but we can figure it out later. (Maybe it is fine but it feels like it's too tied to promise terminology, whereas promises are kind of more an implementation detail, that the underlying byte source should not need to know about.)

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/343#issuecomment-97830002

Received on Thursday, 30 April 2015 15:06:10 UTC