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

I think `controller.close()` would be a strange name for "close the downstream side of the pipe, but error the upstream side".

I think "close the downstream, discard the upstream" is a more useful operation. Although I've realised that the current behaviour actually gives authors the most flexibility. For example, if they have a transformer with a side-effect of generating a hash of all the input data[1], it wouldn't work if we stopped calling `transform()`.

I'd like to get rid of `controller.close()` altogether, but I think it is necessary functionality for potentially infinite inputs.

[1] I don't think transforms with side-effects are a good idea in general. It would be better to tee to a separate WritableStream that does the calculation. But there's definitely demand for transforms with side-effects, and people are going to write them.

-- 
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-324799978

Received on Friday, 25 August 2017 01:29:13 UTC