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

> @@ -517,9 +538,13 @@ Instances of <code>ReadableStream</code> are created with the internal slots des
>  <div class="note">
>    The <code>closed</code> getter returns a promise that will be fulfilled when the stream becomes closed, or rejected
>    if it ever errors.
> +
> +  If the stream is <a>locked to a reader</a>, neither of these will occur until the reader releases its lock.

> we should just let closed work always and not wait for lock to release.

That is bad since then you could be in a state where `state === "waiting"` but (one of the) `closed` fulfilled.

In a (now-deleted, I think?) comment you suggested

```js
return this._reader._lockReleased.then(() => this.closed);
```

I think that might work to ensure that no matter when or where you do `.closed(f, g)`, neither is ever called until the lock is released. I will try to write tests to confirm.

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

Received on Monday, 15 December 2014 21:09:25 UTC