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

This is indeed pretty interesting on the streams level.

In https://github.com/whatwg/streams/commit/8a7d92b559c2b3f5028d9f48b49de90044be35c1 we made `cancel()` immediately kill any pending read requests. I believe if that change gets implemented in Chromium it would invalidate @reillyeon's suggestion.

We did that because it was our belief that if you were canceling the read you were OK losing the memory. Canceling should be a relatively rare operation so re-allocating each time seems OK.

Can you tell us more about your use case where you want to cancel the stream, you want the memory back, but you were unable to wait for the read to complete?

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

Received on Monday, 19 July 2021 20:24:58 UTC