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

cluster-emitter

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cluster-emitter - npm Package Compare versions

Comparing version 0.5.0-SNAPSHOT.1387314416214 to 0.5.0-SNAPSHOT.1388501015412

7

index.js

@@ -241,2 +241,9 @@ //cluster-emitter is a different EventEmitter which allows all messages send between master & slaves, with an additional parameters as 'target'

});
emitter.on('ask-parent-pid', function(childPid){
//just to tell the child the parent's pid, sends null if it's the parent itself asking
if(childPid){
emitter.to([childPid]).emit('reply-parent-pid', process.pid === childPid ? null : process.pid);
}
});
}

@@ -243,0 +250,0 @@ else{

2

package.json
{
"name": "cluster-emitter",
"version": "0.5.0-SNAPSHOT.1387314416214",
"version": "0.5.0-SNAPSHOT.1388501015412",
"description": "cluster-emitter ===============",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -40,2 +40,18 @@ 'use strict';

it('should return parent pid as null', function(done){
this.timeout(500);
var emitter = require('../index');
emitter.should.be.ok;
emitter.once('reply-parent-pid', function(parentPid){
//parentPid should be null
done(parentPid);
});
emitter.emit('ask-parent-pid', process.pid);
})
});

@@ -42,0 +58,0 @@

@@ -111,4 +111,4 @@ 'use strict';

logger.info('[worker:%d] received:%s and will emit:%s', process.pid, eventToMe, echo);
emitter.emit(echo, process.pid);
logger.info('[worker:%d] emitted:%s with payload:%s', process.pid, echo, process.pid);
emitter.emit(echo, process.pid, process.parentPid);
logger.info('[worker:%d] emitted:%s with payload:%s, %s', process.pid, echo, process.pid, process.parentPid);
});

@@ -115,0 +115,0 @@

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