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

luster

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

luster - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0

8

lib/master.js

@@ -418,3 +418,9 @@ var os = require('os'),

this.forEach(function(worker) {
worker.remoteCall.apply(worker, args);
if (worker.ready) {
worker.remoteCall.apply(worker, args);
} else {
worker.on('ready', function(a) {
worker.remoteCall.apply(worker, args);
}.bind(worker, args))
}
});

@@ -421,0 +427,0 @@ };

26

lib/worker_wrapper.js

@@ -192,2 +192,4 @@ var cluster = require('cluster'),

this.ready = false;
/**

@@ -199,3 +201,2 @@ * Listen for cluster#fork and worker events.

this.on('online', this._onOnline.bind(this));
this.on('listening', this._onListening.bind(this));
this.on('disconnect', this._onDisconnect.bind(this));

@@ -211,4 +212,10 @@ this.on('exit', this._onExit.bind(this));

this.on('initialized', this._onInitialized.bind(this));
this.on('ready', this._onReady.bind(this));
});
WorkerWrapper.prototype._onReady = function() {
this.ready = true;
};
/**

@@ -277,2 +284,3 @@ * @event Master#'worker initialized'

/*jshint unused:false*/
this.ready = false;
this._setState(WorkerWrapper.STATES.STOPPED);

@@ -286,2 +294,3 @@ };

WorkerWrapper.prototype._onDisconnect = function() {
this.ready = false;
this._setState(WorkerWrapper.STATES.STOPPING);

@@ -313,19 +322,6 @@ };

WorkerWrapper.prototype._onInitialized = function() {
if (typeof this.options.port === 'undefined') {
this.emit('ready');
}
this.emit('ready');
};
/**
* event:_worker#listening handler
* @fires WorkerWrapper#ready
* @private
*/
WorkerWrapper.prototype._onListening = function() {
if (typeof this.options.port !== 'undefined') {
this.emit('ready');
}
};
/**
* event:cluster#fork handler

@@ -332,0 +328,0 @@ * @private

{
"name" : "luster",
"version" : "0.4.1",
"version" : "0.5.0",
"description" : "Node.js cluster wrapper",

@@ -5,0 +5,0 @@ "main" : "./lib/luster.js",

Sorry, the diff of this file is not supported yet

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