Re: [whatwg/fetch] Odd format for fetch callbacks (#536)

> you mean we would simply not offer a synchronous mode in Fetch?

I think sync fetching is useful in in-parallel steps, but finding cases where I want to do something like (excuse the hand-waving):

1. Let *response* be the result of *fetching* *request*.
1. If *response* is opaque, abort the fetch and abort these steps.
1. Stream *response* into *something*.

I can't do the above, as step one involves waiting for the whole body, so the aborting happens too late, and the streaming is kinda pointless.

If a sync fetch returned before waiting for the body, it'd work fine. In the cases where APIs needed the whole body, they could do:

1. Let *response* be the result of *fetching* *request*.
1. *Wait* for *response*'s body.
1. …

-- 
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/536#issuecomment-387108123

Received on Monday, 7 May 2018 15:45:24 UTC