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.

I'm a bit confused about this description. Does that mean that the promise will not be resolved or rejected until the reader **which is active at the time of calling**? The implementation suggests that, I think.

On the other hand, I'm not sure if the reader **which is active at the time of calling** is important, especially in the following cases:

```
var stream = ...;
var reader = stream.getReader();
reader.closed.then(f, g);
// f and g will not be called until the reader releases its lock.
```

```
var stream = ...;
reader.closed.then(f, g);
var reader = stream.getReader();
// f and g can be called even when the stream is locked.
```

```
var stream = ...;
var reader = stream.getReader();
stream.closed.then(f, g);
reader.release();
var another = stream.getReader();
// f and g can be called even when the stream is locked.
```



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

Received on Monday, 15 December 2014 12:29:51 UTC