Running Node v11.12.0 on Windows 7
Filename: IsClusterStillAlpha.js
const cluster = require('cluster')
if (cluster.isMaster) {
// Master
const worker = cluster.fork()
worker.on('message', function (message) {
console.log('worker got message:', message)
})
} else if (cluster.isWorker) {
// Worker
process.send('sending worker to master')
}
Command to run the script: node IsClusterStillAlpha.js
Core assumption: Worker's can be assigned .on('message', ...) within the master process as per https://github.com/nodejs/node/blame/master/doc/api/cluster.md#L240.
Expected output: Nothing
Actual output: worker got message: sending worker to master
Running Node v11.12.0 on Windows 7
Filename:
IsClusterStillAlpha.jsCommand to run the script:
node IsClusterStillAlpha.jsCore assumption: Worker's can be assigned
.on('message', ...)within the master process as per https://github.com/nodejs/node/blame/master/doc/api/cluster.md#L240.Expected output: Nothing
Actual output:
worker got message: sending worker to master