-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify what Transferable
objects are
#4
Comments
A related issue is that ArrayBuffer are transferable and a transfer sets the byteLength to 0. byteLength :: ArrayBuffer -> Effect ByteLength |
Where does the spec say that? |
https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Transferable_objects // Create an 8MB "file" and fill it. 8MB = 1024 * 1024 * 8 B
const uInt8Array = new Uint8Array(1024 * 1024 * 8).map((v, i) => i);
console.log(uInt8Array.byteLength); // 8388608
// Transfer the underlying buffer to a worker
worker.postMessage(uInt8Array, [uInt8Array.buffer]);
console.log(uInt8Array.byteLength); // 0 The example is for uInt8Array but it is also true for ArrayBuffer. |
😭 Well that throws a wrench into things... |
Description
Replace
Transferable
opaque type with type class based on: https://html.spec.whatwg.org/multipage/structured-data.html#transferable-objectsThe text was updated successfully, but these errors were encountered: