|
|
|
@ -9,6 +9,7 @@
@@ -9,6 +9,7 @@
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
const fetch = require('node-fetch'); |
|
|
|
|
const { parentPort } = require('worker_threads'); |
|
|
|
|
const worker = require('..'); |
|
|
|
|
const getCore = require('./getCore'); |
|
|
|
|
const gunzip = require('./gunzip'); |
|
|
|
@ -17,8 +18,8 @@ const cache = require('./cache');
@@ -17,8 +18,8 @@ const cache = require('./cache');
|
|
|
|
|
/* |
|
|
|
|
* register message handler |
|
|
|
|
*/ |
|
|
|
|
process.on('message', (packet) => { |
|
|
|
|
worker.dispatchHandlers(packet, (obj) => process.send(obj)); |
|
|
|
|
parentPort.on('message', (packet) => { |
|
|
|
|
worker.dispatchHandlers(packet, (obj) => parentPort.postMessage(obj)); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
worker.setAdapter({ |
|
|
|
|