This commit is contained in:
2024-03-08 11:08:05 +09:00
parent 7885c8c8d7
commit c713b858c1
2 changed files with 6 additions and 5 deletions
+3 -5
View File
@@ -1,16 +1,14 @@
import { Worker, parentPort, MessageChannel } from "node:worker_threads";
import { Worker, MessageChannel } from "node:worker_threads";
import * as nodePath from "node:path";
import { fileURLToPath } from "node:url";
console.log("Hello from worker_test.ts!");
const __filename = new URL(import.meta.url).pathname;
const __filename = fileURLToPath(new URL(import.meta.url));
const __dirname = nodePath.dirname(__filename);
const worker_b_ts = nodePath.join(__dirname, "worker_b.ts");
const worker_a_ts = nodePath.join(__dirname, "worker_a.ts");
const worker_b = new Worker(worker_b_ts);
const worker_a = new Worker(worker_a_ts);