Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cluster2

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cluster2 - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

examples/http-server-mult-ports.js

1

examples/express/express-server.js

@@ -39,2 +39,3 @@ /*

cluster: true,
timeout: 500,
ecv: {

@@ -41,0 +42,0 @@ monitor: '/',

2

examples/http-server.js

@@ -21,3 +21,3 @@ /*

//
// A TCP server cluster
// A HTTP server cluster

@@ -24,0 +24,0 @@ var serving = true;

@@ -214,3 +214,3 @@ /*

else {
var listening = false, conns = 0, totalConns = 0;
var listening = false, conns = 0, totalConns = 0, timedoutConns = 0;
process.on('SIGINT', function() {

@@ -249,12 +249,15 @@ self.emitter.emit('SIGINT', {

// Workers are net.Servers.
app.listen(this.options.port, function() {
console.log('Worker ' + process.pid + ' listening on ' + self.options.port);
if(self.options.ecv) {
ecv.enable(app, self.options.port, self.options.ecvPath, self.options.ecv.monitor, function(data) {
return true;
});
}
cb();
});
// Workers are net.Servers
var ports = _.isArray(this.options.port) ? this.options.port : [this.options.port];
_.each(ports, function(port) {
app.listen(port, function() {
console.log('Worker ' + process.pid + ' listening on ' + port);
if(self.options.ecv) {
ecv.enable(app, port, self.options.ecvPath, self.options.ecv.monitor, function(data) {
return true;
});
}
cb();
});
})

@@ -267,2 +270,3 @@ // Set time out on idle sockets

function () {
timedoutConns++;
self.emitter.emit('warning', {

@@ -288,3 +292,18 @@ message: 'Client socket timed out'

}, 100);
// Heartbeat - make sure to clear this on 'close'
// TODO: Other details to include
var heartbeat = setInterval(function () {
self.emitter.emit('heartbeat', {
pid: process.pid,
uptime: Math.round(process.uptime()),
freemem: os.freemem(),
totalConnections: totalConns,
pendingConnections: conns,
timedoutConnections: timedoutConns
});
}, 60000);
app.on('close', function() {
clearInterval(heartbeat);
clearInterval(recycle);

@@ -291,0 +310,0 @@ })

{
"author": "ql.io",
"contributors": [{
"name": "Subbu Allamaraju",
"email": "subbu@ebaysf.com"
}],
"name": "cluster2",
"version": "0.2.4",
"version": "0.2.5",
"repository": {

@@ -6,0 +10,0 @@ "type": "git",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc