Re: [whatwg/streams] Should consumers of readers/streams be notified why a stream was canceled? (#448)

We're trying to make a distinction between "cancelation", which is just "the stream is ending early and you should not care about the results anymore", versus "erroring", which is "the stream has ended early in a bad way; be aware." It's the latter that causes promise rejections. Cancelation should generally be "expected", in that there's nothing wrong with a canceled stream.

> In the current system a consumer will cancel a stream, store a bit that they did cancel it, and then check said bit any time a promise resolves so they ignore the result. Instead what I'm proposing is they just cancel it with a reason, then when a promise rejects if the reason is expected then ignore it. No need to store a variable to remember that you canceled the stream to ignore "phony" results.

This is not generally how cancelation is meant to be used. If you cancel the stream, you should not be reading from it any more. There are no "phony" results; there are in fact zero more results at all.

---
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/448#issuecomment-219542318

Received on Monday, 16 May 2016 20:46:02 UTC