0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00
denoland-deno/cli/tests/workers_basic.ts
Ryan Dahl ed680552a2
fix: basic web worker message passing (#3893)
Removes OP_HOST_GET_WORKER_LOADED, OP_HOST_POLL_WORKER, 
OP_HOST_RESUME_WORKER and ready/messageBuffer in cli/js/workers.ts.
2020-02-05 17:16:07 -05:00

11 lines
259 B
TypeScript

// Tests basic postMessage, close, onmessage
const jsWorker = new Worker("./subdir/test_worker_basic.js", {
type: "module",
name: "jsWorker"
});
jsWorker.onmessage = (e): void => {
console.log("main recv: " + e.data);
};
jsWorker.postMessage("msg1");