You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
When working with multiply machines (I have never done that so I'm just guessing) no a machine should be able to go online without restrating the cluster.
To support multiply machines you need to know when a CPU is gone offline or added:
//A CPU is added or removedrequire('os').on('CPUchange',function(change){//A list of cores change.forEach(function(CPUcore){//If a CPU is appended new workers should be forked if(change.isAppended){cluster.fork();}elseif(change.isRemoved){//this is bad}});});
And know what CPU and/or core the process is running on:
varworkers=[require('child_process').fork('worker.js')];varsystem=newSetup();//Custom system from userland//Disconnect workersystem.on('takeofCPU',function(cpu,callback){//Seach the workers list and disconnect the worker when a CPU ID match is foundworkers.forEach(function(worker){if(worker.cpu.id===cpu.id){worker.disconnect(callback);}});});
When working with multiply machines (I have never done that so I'm just guessing) no a machine should be able to go online without restrating the cluster.
To support multiply machines you need to know when a CPU is gone offline or added:
And know what CPU and/or core the process is running on:
This is to be used in
cluster 2.0
( see: #2038 ).The text was updated successfully, but these errors were encountered: