import { parentPort } from "node:worker_threads";

export function handleWorkerProbe(message: unknown) {
  return message === "ping" ? "pong" : null;
}

const workerPort = parentPort;

if (workerPort) {
  workerPort.on("message", (message: unknown) => {
    workerPort.postMessage(handleWorkerProbe(message));
  });
}
