Re: [fetch] Add timeout option (#20)

I subscribed to this issue time ago because I need connections to fail when they're stuck. However, it's common to have many requests pending because the browser only downloads a limited number simultaneously. Therefore we need a way to timeout a whole group of promises when there hasn't been activity for X amount of time.

I've been using the `timeout` property of XHR but it turns out it's a timeout since `send()` was called, which is like setting a `setTimeout` regardless of traffic. I had to remove the `timeout` because it always failed on slow connections.

In other words, we need several things, independently:
* XHR style timeout, a.k.a. **deadline**: reject the promise when it took too long. Seems easy to polyfill.
* Abort: not needed for this specific issue but very useful (e.g. to cut in traffic and leave room for an alternative, smaller request). #27
* **Timeout since last received data. IMHO, the spec should specify the client will handle stuck files and re-start the connection.**

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

Received on Friday, 11 December 2015 15:57:42 UTC