Re: [streams] Change the model for ReadableStream to have async read() (#288)

> @@ -98,57 +93,45 @@ export default class ReadableStream {
>        resolvePipeToPromise = resolve;
>        rejectPipeToPromise = reject;
>  
> -      source = this.getReader();
> +      source.closed.catch(abortDest);
> +      dest.closed.then(
> +        () => {
> +          if (!closedPurposefully) {

I think you are right. I didn't consider locks on the dest when writing this so if we have those it might be taken care of.

We might even be able to omit this block if the consequences of doing so are not so bad. That is, if the developer has set up a weird situation (like using a duck-typed dest with a `getWriter()` method that returns a writer that conforms to the superficial API contract but doesn't actually prevent closing from the outside), they get weird results.

We'll just want to see which tests fail when we remove this block to make sure.

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

Received on Thursday, 5 March 2015 18:11:29 UTC