Closed wanderview closed 9 years ago
That's why we'll have response.json().cancel()
, no?
Maybe I got confused from this conversation about cancelable promises on #whatwg:
Response.body.cancel() is callable only when the body is not locked by anyone. Hence it is not callabled when Response.json() is running.
To answer the OP's question: yes, it would prevent it from being canceled (except by response.json().cancel()
, i.e. eventual cancelable promises) and yes, this is OK.
It seems maybe Response.json() having a lock on the stream would prevent it from being canceled through body.cancel(). Is this ok?
cc / @domenic @annevk