Re: [streams] getting and releasing reader (#297)

Mainly from Fetch API point of view...

Regarding auto-release:

We had [a long discussion] (https://github.com/slightlyoff/ServiceWorker/issues/452) about Body.bodyUsed which is summalized at https://github.com/tyoshino/streams_integration/blob/master/FetchBodyPrecondition.md. In the discussion, people tended to like a flag which would never be released after locked (e.g. new Request, cache.put()). If it is generally true, leaving an option for a user to "not release" might be good.

Regarding forcible cancel:
Without it, we don't have a means to cancel fetch operation after calling text().

```
var p = res.body.text();

// res.body.cancel doesn't work here, so we can do nothing if the stream is infinite.
```

Not having forcible cancel means that any consumer should have a cancel method, and it should be an object, not a function (i.e. text() is not a good API). (Of course, we could have cancel() on Request or Response, but it looks a bad sign to me.)



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

Received on Friday, 13 March 2015 12:43:32 UTC