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