feat: render threading

This commit is contained in:
TrèsAbhi committed 2023-10-16 20:08:08 -05:00
1 parent 9495ae2336
commit 6fdd4ba833
7 files changed
+73 -5

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
import { parentPort, threadId } from 'worker_threads';
import svgToPng from '../core/blitzkrieg/svgToPng';
console.log(`🟢 Launched render worker ${threadId}`);
parentPort?.on('message', async (svg: string) => {
const png = svgToPng(svg);
parentPort?.postMessage(png);
});