Re: [streams] [Reader] Should resolve readyPromise on getReader() call? (#258)

Gah, I thought I had a test case for this. I guess I missed it though.

Right now the contract for `ready` is that it only fulfills if the state is no longer "waiting". I would prefer to keep that contract if possible. So I don't think resolving it on the `getReader()` call is very good.

I think this might be fixable via something like `return this._readyPromise.then(() => this._reader !== undefined ? this._reader.ready : undefined)` but last time I tried something like that I got stuck in an infinite ping-pong loop between the two `ready`s. I think it is still doable I just need to be careful.

> If it doesn't get resolved while the reader is active, then, we cannot get notified of release of the lock. But I think in such a case, one who was watching the stream is not interested in release of lock but transition to readable/closed. So, this case is also not a problem?

Yes, that is my feeling as well, since people asking for `ready` are really interested in transition to readable/closed/errored (i.e. anything but waiting).

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

Received on Tuesday, 6 January 2015 05:31:48 UTC