Files
2026-08-27 21:09:14 +00:00

12 lines
263 B
TypeScript

import { parentPort, threadId } from "worker_threads";
if (parentPort === null) {
throw new Error("parentPort is null");
}
parentPort.on("message", message => {
if (message.workerId !== threadId) {
throw new Error("threadId is not consistent");
}
});