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

There are no benefits from returning {value: undefined, done: true} after "cancel()" and discarding already received bytes.

Returning {value: byes_read_so_far, done: true} will act much better,  allowing to implement timeout and preserving data.
Also, "cancel()" implemented this way will be compatible with the current implementation.  When done=true, "readable" will be unlocked. For "value" not eq. "undefined" the last chunk will be reliable processed.
It's possibly the "lowest hanging fruit" for many similar requests.
It will partially fulfill other requests eg. #1103



-- 
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

Received on Sunday, 18 July 2021 01:53:11 UTC