Update cluster shim for Bun (yet again)

This commit is contained in:
Dorian Niemiec 2024-08-29 19:28:07 +02:00
parent c3fee277ec
commit 3eb7249c15

View file

@ -26,9 +26,7 @@ if (!process.singleThreaded) {
cluster.worker = { cluster.worker = {
id: parseInt(process.env.NODE_UNIQUE_ID), id: parseInt(process.env.NODE_UNIQUE_ID),
process: process, process: process,
isDead: () => { isDead: () => false,
return false;
},
send: (message, ...params) => { send: (message, ...params) => {
process.send(message, ...params); process.send(message, ...params);
}, },
@ -98,9 +96,7 @@ if (!process.singleThreaded) {
}); });
newWorker.process = newWorker; newWorker.process = newWorker;
newWorker.isDead = () => { newWorker.isDead = () => newWorker.exitCode !== null || newWorker.killed;
return newWorker.exitCode !== null || newWorker.killed;
};
newWorker.id = newEnvironment.NODE_UNIQUE_ID; newWorker.id = newEnvironment.NODE_UNIQUE_ID;
function checkSendImplementation(worker) { function checkSendImplementation(worker) {