[fetch] Add option to automatically abort response stream if the data stopped arriving for longer than a specified time (#180)

I'd like to have an option to abort (internally by the browser, not via a JS API) requests that have stalled, i.e. close the TCP/IP connection if the time since the last bit data received exceeded a specified timeout.

This is different from a deadline (#179), because it allows very slow, but steady, responses to stream forever.

```js
fetch('/1MB.json', {timeout: 5000}).then(res => res.json);
```

This promise would succeed on a GPRS connection with a good signal that requires 4 minutes to download the file, but thanks to a good signal it delivers the file at a good consistent pace.

This promise would fail on a 4G connection after 5 seconds since the user lost signal, even if portion of the file has already been downloaded, but due to lost signal the rest of the file stopped arriving.


---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/180

Received on Monday, 14 December 2015 15:30:08 UTC