Skip to content

Commit

Permalink
refactor(ext/node): remove worker_threads dependency on ext:runtime (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
satyarohith committed Apr 3, 2024
1 parent 778b0b8 commit aa08155
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ext/node/polyfills/worker_threads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
serializeJsMessageData,
} from "ext:deno_web/13_message_port.js";
import * as webidl from "ext:deno_webidl/00_webidl.js";
import { log } from "ext:runtime/06_util.js";
import { notImplemented } from "ext:deno_node/_utils.ts";
import { EventEmitter } from "node:events";
import { BroadcastChannel } from "ext:deno_broadcast_channel/01_broadcast_channel.js";
Expand All @@ -38,6 +37,14 @@ const {
TypeError,
} = primordials;

const debugWorkerThreads = false;
function debugWT(...args) {
if (debugWorkerThreads) {
// deno-lint-ignore prefer-primordials
console.log(...args);
}
}

export interface WorkerOptions {
// only for typings
argv?: unknown[];
Expand Down Expand Up @@ -190,7 +197,7 @@ class NodeWorker extends EventEmitter {
break;
}
case 3: { // Close
log(`Host got "close" message from worker: ${this.#name}`);
debugWT(`Host got "close" message from worker: ${this.#name}`);
this.#status = "CLOSED";
return;
}
Expand Down

0 comments on commit aa08155

Please sign in to comment.