2023-10-16 20:08:08 -05:00
|
|
|
import { parentPort, threadId } from 'worker_threads';
|
2024-04-20 12:00:48 -05:00
|
|
|
import svgToPng from '../core/blitzrinth/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);
|
|
|
|
|
});
|