mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
12 lines
353 B
TypeScript
12 lines
353 B
TypeScript
import { parentPort, threadId } from 'worker_threads';
|
|
import { svgToPng } from '../core/blitzkit/svgToPng';
|
|
|
|
console.log(`🟢 Launched render worker ${threadId}`);
|
|
|
|
parentPort?.on('message', async (svg: string) => {
|
|
const png = svgToPng(svg);
|
|
parentPort?.postMessage(png);
|
|
});
|
|
|
|
console.log(`post render thread parent port on thread ${threadId}`);
|