mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00

Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
This commit removes "WorkerGlobalScope" global from the "global middleware" that we use to provide different set of globals to user code and npm packages. This is done, by renaming "WebWorkerType" to "WorkerThreadType" and introducing a "Node" variant - this variant is used when creating a worker using "node:worker_threads" module. This worker does not have a "WorkerGlobalScope" (because it's not a Web Worker) and the regular Web Worker created using "new Worker" does have it.
12 lines
355 B
TypeScript
12 lines
355 B
TypeScript
import { Worker as WorkerThread } from "node:worker_threads";
|
|
|
|
new Worker(new URL("./worker1.ts", import.meta.url), {
|
|
type: "module",
|
|
});
|
|
new Worker(new URL("./worker2.ts", import.meta.url), {
|
|
type: "module",
|
|
});
|
|
new Worker(new URL("./worker3.ts", import.meta.url), {
|
|
type: "module",
|
|
});
|
|
new WorkerThread(new URL("./worker4.mjs", import.meta.url));
|