Re: [streams] New proposal for byte stream uses cases (#289)

> read() has the same signature as ReadableStream (object stream), but how piping between object stream and byte stream would be like? I think we should list what we mean by "compatibility with object stream" concretely and prototype how it'll be like.

Definitely agree. We don't even have a design for WritableByteStream yet :-/. We need to get on this. I will start trying to draw up the landscape tomorrow.

> Does wait() call required for each read() even for object stream or it'll be just like the old ReadableStream where it's just a kicking switch of pulling.

I think more like the latter. In this way a ReadableByteStream is like a ReadableStream with HWM = 0 that always respects backpressure *and* doesn't proactively fill up the queue.

> Just a naming preference, but I prefer pull() to wait().

Yes, I think that is better. wait() was originally there for symmetry with writable stream but I think it was largely a false symmetry from when we were more naive.

---

OK. I have a lot of work to do tomorrow. I will try to write up examples of the entire ecosystem: readable streams, writable streams, exclusive readers, exclusive writers, byte versions of each of these four, and with both pull and push underlying sources (i.e. fread-style and epoll-style). If we don't discover a fatal flaw based on the examples we can start prototyping the readable side to make sure that exclusive readers are not too complex. If they are too complex, we can consider making pipeTo magical, as per original #241.

Actually, maybe we should consider just making pipeTo magical to start with. Then we could introduce exclusive readers later to explain pipeTo. It might be tricky to do backward-compatibly (e.g. introducing a new state value seems possibly hostile). But it's worth considering.

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

Received on Friday, 27 February 2015 04:45:48 UTC