Re: [streams] Warning misbehaving underlying sources (#298)

Re: error,

It seems we don't have any path to notify the underlying source of that the `[[error]]` has been called (until the source calls `enqueue()`), and that's because the only sources of error which results in invoking `[[error]]` are the strategy or the underlying source itself? So, ...:

1. the source cannot know when an error occurred
1. there's no way for the consumer to error the stream

Hmm, though (1) means that the source cannot avoid bad `error()`/`close()` call, given (2), I think it's fine to throw for `error()`/`close()` from a source on an errored stream.

----

Re: close,

Hmm, maybe that's the only place where unsolicited close() happens? So, ok, the consumer is no longer interested in data, and the underlying source has finished work. Sounds like it's ok to just make `close()` after `reader.cancel()` no-op (no throwing) for convenience though the underlying source CAN know when `cancel()` happened.

I.e. throw only when draining.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/298#issuecomment-82221315

Received on Tuesday, 17 March 2015 09:10:04 UTC