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');

Hmm, but that kind of sucks because what if you want to asynchronously make the decision to put it back or not?

Maybe we need `.read({ preventClose: true })`?? But then how do you close it later? `.cancel()` I guess??? Icky.

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

Received on Friday, 6 February 2015 05:18:34 UTC