mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 00:11:49 +03:00
20 lines
409 B
JavaScript
20 lines
409 B
JavaScript
|
const {parentPort} = require('bthreads');
|
||
|
|
||
|
setInterval(() => { }, 10);
|
||
|
|
||
|
if (parentPort) {
|
||
|
parentPort.on('message', (message) => {
|
||
|
if (message === 'error') {
|
||
|
throw new Error('oops');
|
||
|
}
|
||
|
|
||
|
if (message === 'cancel') {
|
||
|
parentPort.postMessage('cancelled');
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
parentPort.postMessage(message);
|
||
|
process.exit(0);
|
||
|
});
|
||
|
}
|