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.2 to 0.2.3

6

lib/index.js

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

this.options.ecvPath = this.options.ecvPath || '/ecv';
this.options.monPath = this.options.monPath || '/';
this.options.noWorkers = this.options.noWorkers || os.cpus().length;

@@ -61,5 +62,6 @@ }

port: self.options.port,
monPort: self.options.monPort || '3001',
path: self.options.monPath || '/',
monPort: self.options.monPort,
monPath: self.options.monPath,
ecv: self.options.ecv,
ecvPath: self.options.ecvPath || '/ecv',
noWorkers: self.options.noWorkers,

@@ -66,0 +68,0 @@ timeout: self.options.timeout || 30 * 1000, // idle socket timeout

@@ -160,4 +160,4 @@ /*

stats: self.stats,
port: self.options.monPort || '8081',
path: self.options.monPath || '/'}
port: self.options.monPort,
path: self.options.monPath}
);

@@ -164,0 +164,0 @@ monitor.on('error', function (e) {

{
"author": "ql.io",
"name": "cluster2",
"version": "0.2.2",
"version": "0.2.3",
"repository": {

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

@@ -8,5 +8,5 @@

our needs in operationalizing node.js for [ql.io](https://github.com/ql-io/ql.io) at eBay. Built on
node's `cluster`, cluster2 provides several several additional capabilities:
node's `cluster`, cluster2 provides several additional capabilities:
* Scriptable start, shutdown and stop
* Scriptable start, shutdown and stop flows
* Worker monitoring for process deaths

@@ -16,3 +16,3 @@ * Worker recycling

* Idle timeouts
* Validation hook (for other tools to monitor cluster2 apps)
* Validation hooks (for other tools to monitor cluster2 apps)
* Events for logging cluster activities

@@ -143,19 +143,4 @@

var Cluster = require('cluster2'),
var winston = require('winston'),
http = require('http');
var logger = new (winston.Logger)({
transports: [
new (winston.transports.File)({
filename: process.cwd() + '/logs/myapp.log',
maxsize: 1024000 * 5,
colorize: false,
json: true,
timestamp: function () {
return new Date();
}
})
]
});
var server = http.createServer(function (req, res) {

@@ -166,12 +151,13 @@ res.writeHead(200);

var c = new Cluster({
cluster: true,
port: 3000
});
c.on('died', function(pid) {
winston.log('Worker ' + pid + ' died');
console.log('Worker ' + pid + ' died');
});
c.on('forked', function(pid) {
winston.log('Worker ' + pid + ' forked');
console.log('Worker ' + pid + ' forked');
});
c.on('SIGKILL', function() {
winston.log('Got SIGKILL');
console.log('Got SIGKILL');
});

@@ -182,3 +168,3 @@ c.on('SIGTERM', function(event) {

c.on('SIGINT', function() {
winston.log('Got SIGINT');
console.log('Got SIGINT');
});

@@ -185,0 +171,0 @@ c.listen(function(cb) {

Sorry, the diff of this file is not supported yet

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