Skip to content
Snippets Groups Projects
Commit 487a6b70 authored by Jono Wenger's avatar Jono Wenger
Browse files

Remove postMessageTransferList since it does not look like it is possible from wasm

parent 6db70285
No related branches found
No related tags found
2 merge requests!67fix for latest client release,!52XX-4382 / Move indexedDb databases to web workers
......@@ -166,17 +166,3 @@ func (mh *MessageHandler) addEventListeners() {
func (mh *MessageHandler) postMessage(aMessage any) {
js.Global().Call("postMessage", aMessage)
}
// postMessageTransferList sends an array of Transferable objects to transfer to
// the main thread. This is meant to be used to transfer large amounts of binary
// data using a high-performance, zero-copy operation. Refer to the doc for more
// information.
//
// Note: The binary data cannot simply be passed as the transferList. The
// traversable objects must be specified in the aMessage and included in the
// transferList
//
// Doc: https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope/postMessage
func (mh *MessageHandler) postMessageTransferList(aMessage, transferList any) {
js.Global().Call("postMessage", aMessage, transferList)
}
......@@ -21,10 +21,9 @@ import (
// TODO:
// 1. Fix ID counter
// 2. Use transfer list when sending
// 3. Get path to JS file from bindings
// 4. restructure packages
// 5. fix tag system
// 2. Get path to JS file from bindings
// 3. restructure packages
// 4. fix tag system
// InitID is the ID for the first item in the handler list. If the list only
// contains one handler, then this is the ID of that handler. If the list has
......@@ -267,20 +266,6 @@ func (wh *WorkerHandler) postMessage(msg any) {
wh.worker.Call("postMessage", msg)
}
// postMessageTransferList sends an array of Transferable objects to transfer to
// the worker. This is meant to be used to transfer large amounts of binary data
// using a high-performance, zero-copy operation. Refer to the doc for more
// information.
//
// Note: The binary data cannot simply be passed as the transferList. The
// traversable objects must be specified in the aMessage and included in the
// transferList
//
// Doc: https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage#transfer
func (wh *WorkerHandler) postMessageTransferList(msg, transferList any) {
wh.worker.Call("postMessage", msg, transferList)
}
// newWorkerOptions creates a new Javascript object containing optional
// properties that can be set when creating a new worker.
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment