Re: [streams] Requirement on promises equality (#266)

> > Can we ensure p === q === r?

> I don't think so, unless we significantly change the ergonomics of how readers work. Since rs.ready must

I think Yutaka meant whether we can make p === q === r when the stream stays to be waiting or not.

Of course, we cannot return the same promise instance beyond `"waiting"` to `"readable"` transition. We discussed how much we can keep it unchanged.

The ideally stable behavior is that as far as there's no state transition visible to stream user (not reader user) happened, `rs.ready` returns the same promise. We can realize this by caching the promise returned at `p` and keep returning it until state transition happens and it becomes visible to the user (the stream is unlocked). But to implement this, we need to change the fulfillment callback to call some internal only method since `rs.ready` would then return the cached promise.

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

Received on Tuesday, 3 February 2015 14:25:55 UTC