- From: Tab Atkins Jr. <notifications@github.com>
- Date: Fri, 17 Sep 2021 15:23:32 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/fetch/issues/1306@github.com>
The fetch algo takes five algorithms as input, of which three deal with the response: `processResponse`, `processResponseEndOfBody`, and `processResponseDone`. No explanation is given as to when each of these run or what each is for. The two examples I've found of correct usage of the fetch algo ([fetch() itself](https://fetch.spec.whatwg.org/#dom-global-fetch) and [XHR.send()](https://xhr.spec.whatwg.org/#the-send()-method)) each use processResponse, and fetch also uses processResponseDone. From reading the fetch algorithm in detail, I can infer that processResponse is called early, as soon as the request finishes, so you can do things like handle progress events or immediately handle errors. It's not clear to me if this is an idiom to be followed, or if it's okay to do all the processing in one of the later-occurring algos. I don't know what the difference is between processResponseEndOfBody and processResponseDone, other than that, again from reading the fetch algo in detail, they're called in that order, with some degree of processing happening between them that I'm not sure of the details of. So I'm not sure what sort of tasks are appropriate to do in one vs the other. Could we get some explanation of these inputs in <https://fetch.spec.whatwg.org/#fetch-params-process-request-body> maybe? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/fetch/issues/1306
Received on Friday, 17 September 2021 22:23:44 UTC