mirror of
https://github.com/denoland/deno.git
synced 2024-12-13 11:02:19 -05:00
2fa0096821
Adds another callback to WebWorkerOptions that allows to execute some modules before actual worker code executes. This allows to set up Node global using std/node.
9 lines
185 B
JavaScript
9 lines
185 B
JavaScript
console.log("hello from worker");
|
|
|
|
self.onmessage = (e) => {
|
|
if (e.data != "hello") {
|
|
throw new Error("wrong message");
|
|
}
|
|
|
|
self.postMessage({ pid: process.pid });
|
|
}
|