Re: [streams] Should readable streams start right away? (#269)

> In the Fetch's Response's case, the underlying source lives and is hidden in the Response?

Agreed.

> It doesn't look so weird if the text(), body(), etc. ask the internal underlying source to "start" the stream when they are called.

Agreed.

> What do you think this reasoning if combined with slightlyoff/ServiceWorker#606 (comment)?

I think it's valid reasoning. But there's another point of view which is equally valid IMO, *if you look only at the public API and not how it's implemented*. Which is that, the `body` getter returns the stream which has an underlying source that is already started (but not yet finished starting/pulling). The developer cannot tell the difference, based on the public API only, between:

1. `body` getter lazily creates a ReadableStream (which automatically starts the underlying source)
2. `body` getter returns an already-created ReadableStream which hasn't finished starting/pulling yet.

So I am OK with either a method (which kind of implies interpretation 1) or a getter (which kind of implies interpretation 2).

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

Received on Thursday, 22 January 2015 15:54:28 UTC