Re: [streams] WIP: exclusive reader interface (#251)

Right now I am struggling with what to do when the stream closes and/or whether the reader should stop working after the lock is released.

- If we don't automatically release the lock when the stream closes, any consumers of the original stream could be left hanging forever waiting for the stream to close. Maybe this is OK though, because if you forget to release a lock, you're a bad person and you deserve the havoc you've caused?
- If we do auto-release the lock when the stream closes, then we have to be careful. Since the underlying source controls the stream closing, it's outside the control of the user of the reader. So if e.g. `state` starts throwing upon access when the stream closes, that's going to be bad, unless we force a check for `reader.isActive` before every `reader.state` access.
- Maybe we should allow `state`, `ready`, and `closed`---i.e., the non-mutating getters/methods---to be used even on a reader that's been released?


---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/251#issuecomment-66701976

Received on Thursday, 11 December 2014 22:36:07 UTC