- From: Adam Rice <notifications@github.com>
- Date: Thu, 13 Aug 2020 19:44:11 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 14 August 2020 02:44:23 UTC
The original transferable streams issue has been closed now that support has been landed, however the discussion of the double transfer problem that started at https://github.com/whatwg/streams/issues/276#issuecomment-482797085 and consumed the rest of the thread is not concluded. Summarising the issue, the following code works fine: ```javascript const worker = new Worker(`data:text/javascript,onmessage = evt => postMessage(evt.data, [evt.data]);`); const rs = new ReadableStream(); worker.postMessage(rs, [rs]); let transferred_rs; worker.onmessage = evt => { transferred_rs = evt.data; }; ``` However, if you subsequently run `worker.terminate()` then `transferred_rs` will start returning errors. For other transferable types, no connection remains with any previous realms that the object was passed through, but in the case of streams, data is still being proxied via the worker. See the linked thread for why this is hard to fix. -- 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/1063
Received on Friday, 14 August 2020 02:44:23 UTC