Re: [whatwg/streams] Communication between workers/windows via Streams API (#244)

My current plan is to do the work in two stages. The first stage will only clone chunks. This will be inefficient for ArrayBuffers and transferring stream-of-streams will still not be supported.

As a second stage, the `write()` and `enqueue()` APIs will gain a second _transferList_ argument. When this argument is used, the chunks will be serialised immediately and queued in their serialised form. They will then be deserialised before being returned from `read()` or passed to underlying sink `write()` or transformer `transform()`. In particular, they will _not_ be deserialised when sent through a pipe.

The new syntax can be used with an empty _transferList_ to get "unshared object" semantics, meaning that changing an object after passing it to a stream will have no impact on the object that is returned from the stream. This is a similar idea to how the byte stream API protects against concurrent modification of the data, and is nice from the point of view of enforcing correctness.

-- 
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/244#issuecomment-394591090

Received on Tuesday, 5 June 2018 05:59:07 UTC