Files
blitzkit/packages/bot/src/workers/render.ts
T

11 lines
353 B
TypeScript
Raw Normal View History

2023-10-16 20:08:08 -05:00
import { parentPort, threadId } from 'worker_threads';
2024-09-08 10:11:24 -05:00
import { svgToPng } from '../core/blitzkit/svgToPng';
2023-10-16 20:08:08 -05:00
console.log(`🟢 Launched render worker ${threadId}`);
parentPort?.on('message', async (svg: string) => {
const png = svgToPng(svg);
parentPort?.postMessage(png);
});
2024-12-13 10:58:16 -06:00
console.log(`post render thread parent port on thread ${threadId}`);