CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
parallel-plugin-worker.mjs29 linesDownload Raw Back to dist
1import { n as __toESM, t as require_binding } from "./shared/binding-Dh6LYCIB.mjs";2import { i as PluginContextData, n as bindingifyPlugin } from "./shared/bindingify-input-options-CzVhGygm.mjs";3import { parentPort, workerData } from "node:worker_threads";4//#region src/parallel-plugin-worker.ts5var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);6const { registryId, pluginInfos, threadNumber } = workerData;7(async () => {8	try {9		(0, import_binding.registerPlugins)(registryId, await Promise.all(pluginInfos.map(async (pluginInfo) => {10			const definePluginImpl = (await import(pluginInfo.fileUrl)).default;11			const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });12			return {13				index: pluginInfo.index,14				plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, [], []), [], () => {}, "info", false)15			};16		})));17		parentPort.postMessage({ type: "success" });18	} catch (error) {19		parentPort.postMessage({20			type: "error",21			error22		});23	} finally {24		parentPort.unref();25	}26})();27//#endregion28export {};29