mirror of
https://github.com/denoland/deno
synced 2024-08-27 20:09:17 +00:00
![andy finch](/assets/img/avatar_default.png)
* Refactored the way worker polling is scheduled and errors are handled. * Share the worker future as a Shared
15 lines
344 B
TypeScript
15 lines
344 B
TypeScript
const jsWorker = new Worker("tests/subdir/test_worker.js");
|
|
const tsWorker = new Worker("tests/subdir/test_worker.ts");
|
|
|
|
tsWorker.onmessage = e => {
|
|
console.log("Received ts: " + e.data);
|
|
};
|
|
|
|
jsWorker.onmessage = e => {
|
|
console.log("Received js: " + e.data);
|
|
|
|
tsWorker.postMessage("Hello World");
|
|
};
|
|
|
|
jsWorker.postMessage("Hello World");
|