Re: [whatwg/streams] Calling close() on TransformStreamDefaultController should relieve backpressure (#774)

If you'll indulge me, I'm kind of unclear on the semantics of a transform controller's close().

I guess the situation is when you want to discard any further incoming data. You're signaling that everything you've seen so far is enough, and now you're successfully done. E.g. you could imagine a findFirstPrime transformer: [1, 4, 6, 9, 7, 10, 2] (length = 7) -> [false, false, false, false, true] (length = 5).

In that scenario do we say that attempting to transform the 10 is a failure? Probably, just like attempting to write to any other closed writable stream is a failure. OK, that makes sense. But the readable side never gets marked as errored, right?

In this situation you have [0, 1, 2] -> [0]. Do we count the pipe as failed, or succeeded? Your test indicates failed, which I guess is pretty baked in to the semantics of pipeTo: if the writable side errors, everything blows up. But it seems like disallowing early-quitting in this way is a bit bad.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/774#issuecomment-324219078

Received on Wednesday, 23 August 2017 04:40:11 UTC