We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test code
var cluster = require('cluster'); var sticky = require('sticky-session'); const PORT=5000; var totalReqs = 0; var localReq = 0; var server = require('http').createServer(function(req, res) { res.end(process.pid+ ' worker: ' + cluster.worker.id); process.send(" worker " + process.pid + " local is " + localReq + " sum is " + totalReqs); }); if (!sticky.listen(server, PORT)) { // Master code if (cluster.isMaster) { Object.keys(cluster.workers).forEach(function(i){ cluster.workers[i].on('message', function(msg) { totalReqs++; console.log(totalReqs); }); }); } server.once('listening', function() { console.log('server started on port',PORT); }); } else { // Worker code console.log(process.pid); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
test code
The text was updated successfully, but these errors were encountered: