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,
|
serializeJsMessageData,
|
||||||
} from "ext:deno_web/13_message_port.js";
|
} from "ext:deno_web/13_message_port.js";
|
||||||
import * as webidl from "ext:deno_webidl/00_webidl.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 { notImplemented } from "ext:deno_node/_utils.ts";
|
||||||
import { EventEmitter } from "node:events";
|
import { EventEmitter } from "node:events";
|
||||||
import { BroadcastChannel } from "ext:deno_broadcast_channel/01_broadcast_channel.js";
|
import { BroadcastChannel } from "ext:deno_broadcast_channel/01_broadcast_channel.js";
|
||||||
|
@ -38,6 +37,14 @@ const {
|
||||||
TypeError,
|
TypeError,
|
||||||
} = primordials;
|
} = primordials;
|
||||||
|
|
||||||
|
const debugWorkerThreads = false;
|
||||||
|
function debugWT(...args) {
|
||||||
|
if (debugWorkerThreads) {
|
||||||
|
// deno-lint-ignore prefer-primordials
|
||||||
|
console.log(...args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export interface WorkerOptions {
|
export interface WorkerOptions {
|
||||||
// only for typings
|
// only for typings
|
||||||
argv?: unknown[];
|
argv?: unknown[];
|
||||||
|
@ -190,7 +197,7 @@ class NodeWorker extends EventEmitter {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3: { // Close
|
case 3: { // Close
|
||||||
log(`Host got "close" message from worker: ${this.#name}`);
|
debugWT(`Host got "close" message from worker: ${this.#name}`);
|
||||||
this.#status = "CLOSED";
|
this.#status = "CLOSED";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue