streams/transferable-streams-explainer.md at master · whatwg/streams · GitHub

/transferable-streams-explainer.md

  • « Transferable Streams Explained » WhatWG, Adam Rice
    https://github.com/whatwg/streams/blob/master/transferable-streams-explainer.md
    #webstreams #datapipes

    « The streams APIs provide ubiquitous, interoperable primitives for creating, composing, and consuming streams of data. A natural thing to want to do with a stream is pass it off to a web worker. This provides a building block that is easy and natural to use for offloading work onto another thread. Once you can speak the language of streams, you can use that same language to make use of a Worker.

    This work will permit streams to be transferred between workers, frames and anywhere else that ˋpostMessage()ˋ can be used. Chunks can be anything which is cloneable by ˋpostMessage()ˋ.

    Initially chunks enqueued in such a stream will always be cloned, ie. all data will be copied. Future work will extend the Streams APIs to support transferring objects (ie. zero copy). […] » ⟵ Streams would become Transferable Objects! wouhouuuu