- From: Anne van Kesteren <notifications@github.com>
- Date: Mon, 15 Feb 2021 09:02:23 -0800
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/fetch/issues/661/779349676@github.com>
As far as I can tell we need two operations here and both would make the overall setup more verbose... 1. To **read body incrementally**, given a body _body_, an algorithm _processBytes_, an optional algorithm _processEndOfBody_ , and an optional algorithm _processError_, ... 2. To **read body**, given a body _body_, an algorithm _processBody_, and an optional algorithm _processError_, ... Both 1 and 2 could be used by XMLHttpRequest so it would no longer have to talk about streams directly. The algorithms would be invoked from a parallel queue so the caller will have to use "queue a global task" as needed. We could create a wrapper that does that as well I suppose. (Maybe that's better, we add "in parallel" to the names of the algorithms above and the names above would queue tasks instead. What realm though? The current realm? The magical realm we might add for class construction and such?) However, Fetch has "process response end-of-body" which I suppose we could remove. But Fetch also needs the entire body to be readable for integrity metadata checks. That's what https://fetch.spec.whatwg.org/#concept-body-wait is for. Should that basically tee (and wait, to avoid returning it before we know if it's safe)? Otherwise we cannot read it twice, right? -- 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/661#issuecomment-779349676
Received on Monday, 15 February 2021 17:02:35 UTC