-
-
Notifications
You must be signed in to change notification settings - Fork 33
Worker
ialex32x edited this page Jan 20, 2025
·
3 revisions
Worker is currently supported as an experimental feature with limitations:
- Can not use script classes (GodotJSScript) in workers
-
transferable objectsare not supported -
onerrorandonreadyevents are not implemented yet
// tests/master.ts
// ...
let worker = new Worker("tests/worker");
worker.onmessage = function (m: any) {
console.log("master: get message", m);
worker.terminate();
}
worker.postMessage("hello");// tests/worker.ts
onmessage = function (m: any) {
console.log("worker: get message", m);
postMessage("worker result");
// worker can terminate itself by calling `close()`
// close();
}-
Scripting
-
Utilities
-
Experimental Features
-
Advanced
-
Misc