mirror of
https://github.com/denoland/deno.git
synced 2025-01-03 04:48:52 -05:00
refactor(ext/node): remove worker_threads dependency on ext:runtime (#23206)
This commit is contained in:
parent
778b0b8eb5
commit
aa08155fd1
1 changed files with 9 additions and 2 deletions
|
@ -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";
|
||||
|
@ -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[];
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue