Re: [whatwg/streams] Allow stream reader cancel() method to return bytes from queue instead of discarding them. (#1147)

https://streams.spec.whatwg.org/#rs-prototype
>4.4.3. Constructor, methods, and properties
**(For web developer non-normative)**
await reader.cancel([ reason ])
If the reader is active, behaves the same as stream.cancel(reason).

It seems to be non-normative implementation detail rather then specification part.

It is deliberatelly designed this way so time to close. Maybe the desired behaviour will be implemented as abortable read.
https://github.com/whatwg/streams/issues/1103

https://github.com/whatwg/streams/pull/1123
>From the other direction, if a stream consumer wants to cancel the stream (thus closing it), do they really expect to get their buffer back? It seems like annoying boilerplate to require that underlying source authors intercept cancels and send back the buffer. I'm inclined to just say that if you cancel the stream, you won't get your buffer back.
 

-- 
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/streams/issues/1147#issuecomment-884928316

Received on Thursday, 22 July 2021 13:50:55 UTC