Closed domenic closed 9 months ago
Fetch itself is always in parallel at that point, no? Per step 11 of https://fetch.spec.whatwg.org/#concept-main-fetch. (To be clear, no disagreement that this can all be improved.)
Yep, my eyes totally glazed over that step; sorry!
What is the issue with the Fetch Standard?
Some time ago we refactored fetch to be callable from everywhere, including the main thread, with callbacks to signal the result.
In this world, fetch calls "handle fetch" without going in parallel. It's assumed that "handle fetch" synchronously returns a response.
Handle fetch does synchronously return a response. But it does so with various "Wait" calls, e.g.
In general it's very unclear to me exactly how Handle Fetch is anticipating being called, actually... sometimes it explicitly goes in parallel itself. Sometimes it manipulates main-thread objects like promises. Sometimes it queues tasks, as if it was already in parallel. But, probably it's best to assume it's supposed to be executing in parallel.