Re: [ServiceWorker] Can we change the body attribute of Request/Response to a method? (#606)

> Personally, I'd like stream() to behave similar to text(), json(), etc. On first call it returns an async thing (Promise or Stream). On subsequent calls it rejects with bodyUsed, etc.

This is kind of the heart of the issue. Namely, should subsequent calls return the same stream object, or a new one?

I think it'd be pretty weird for subsequent calls to return a new, always-errored stream.

Maybe a `body` getter is the better approach, even if it has to kick off an IPC in the background for Blink. The user-facing model is no different, after all---it is just an unobservable optimization that if you *don't* touch the `body` getter, no IPC happens.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/606#issuecomment-70897898

Received on Wednesday, 21 January 2015 18:54:46 UTC