Re: [fetch] Removed promise antipattern from code example (#227)

This was discussed a bit during the merge. There is a slight problem here, which is that the form @bergus advocates will cause memory to be consumed for the entire chain of promises (i.e. the first chunk's promise cannot be GCed until the last chunk's promise is GCed, which does not happen until the stream is closed/errored). This is a design flaw/bug of promises, discussed a lot previously in https://github.com/domenic/cancelable-promise/pull/1 and linked places.

I am on the fence on this, but maybe it is better to advocate the "leaky" pattern in the hopes that we will one day fix it/optimize it in implementations?

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/227#issuecomment-190692983

Received on Tuesday, 1 March 2016 12:17:48 UTC