mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-11 16:26:20 +00:00
Fix worker_pool for node
This commit is contained in:
@@ -94,8 +94,8 @@ export default class WorkerPool {
|
||||
}
|
||||
|
||||
static useThisThreadAsWorker(cb) {
|
||||
parentPort.addEventListener("message", async ev => {
|
||||
const { msg, id } = ev.data;
|
||||
parentPort.on("message", async data => {
|
||||
const { msg, id } = data;
|
||||
const result = await cb(msg);
|
||||
parentPort.postMessage({ result, id });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user