Re: [whatwg/streams] pipeTo: Read fulfilled after shutdown started (Issue #1207)

> Would it also work to check if dest.[[state]] is "errored" before doing any reads from source?

I think that might work, yes. Sounds doable. 👍 

> It's unfortunate that both that solution (if it works) and the error callbacks one would make pipeTo unimplementable using public APIs. It was always a nice story that pipeTo was a higher-level combinator and the fundamental reader/writer APIs had just as much power. But maybe we have already crossed that bridge; I'm not sure...

You can still get 99% of the way there with only the reader and writer APIs. It's just that for that final 1%, you need the ability to *synchronously* read the stream's state, which is currently not possible with just those public APIs. (And believe me, I tried! See exhibit [1](https://github.com/MattiasBuelens/web-streams-polyfill/pull/99) and [2](https://github.com/MattiasBuelens/web-streams-polyfill/pull/106). 😅)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/1207#issuecomment-1015923307

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/issues/1207/1015923307@github.com>

Received on Tuesday, 18 January 2022 23:22:49 UTC