Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

postMessage Data and Vector to a web worker, transferring buffer content #17

Merged
merged 6 commits into from
Nov 30, 2023

Conversation

kylebarron
Copy link
Member

@kylebarron kylebarron commented Nov 28, 2023

Change list

  • Add force option onto hardClone to always clone, even if not necessary to be transferred. (defaults to false)
  • preparePostMessage to:
    • hard clone backing ArrayBuffers if they're a view on a larger ArrayBuffer
    • Get a list of transferables
    • Assign DataType.typeId onto __type so that it can accurately be reconstructed on the other side of a postMessage
  • rehydrateData and rehydrateVector to recreate full arrow classes from post messaged data
  • Minimal test that transferring and rehydrating works! Using node's structuredClone

@kylebarron kylebarron changed the title Get transferables and rehydrate in worker postMessage Data and Vector to a web worker, transferring buffer content Nov 30, 2023
@kylebarron kylebarron merged commit 60fdf47 into main Nov 30, 2023
@kylebarron kylebarron deleted the kyle/transferables branch November 30, 2023 20:07
@kylebarron kylebarron mentioned this pull request Nov 30, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant