Re: [streams] [WIP] Putting a chunk back in the readable stream queue (#275)

> @@ -159,6 +159,42 @@ export function IsReadableStream(x) {
>    return true;
>  }
>  
> +export function PutBackIntoReadableStream(stream, chunk) {
> +  if (stream._state === 'closed') {
> +    throw new TypeError('stream is closed');

I think you're right. I'm not sure what the right solution would be though :(. Maybe, after reading the last chunk from the queue, delay for a turn before deciding to close the stream? That gives you a one-turn grace period.

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

Received on Thursday, 5 February 2015 17:58:22 UTC