Re: [whatwg/streams] can streams be transferred via postMessage()? (#276)

I thought this wouldn't work because both `PipeTo()` and **transfer-receiving steps** would both try to set the state on the transferred stream. But on further reflection, it's probably okay:
```
state=readable: PipeTo won't try to change the state, so no problem
state=closed: PipeTo will try to close it, but it's a no-op to close a closed stream, so no problem
state=errored: PipeTo will try to error it, but it's a no-op to error and errored stream, so again no problem
```
The real difficult case is WritableStream, because the queue can be non-empty, and you shouldn't clone the chunks if you're going to pipe 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/276#issuecomment-656391449

Received on Thursday, 9 July 2020 23:01:33 UTC