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.5.2 to 0.5.3

32

lib/worker.js
var cluster = require('cluster'),
RPC = require('./rpc'),
ClusterProcess = require('./cluster_process'),
legacy = require('./legacy'),
Worker;

@@ -28,2 +29,5 @@

this._foreignPropertiesReceived = false;
this.on('foreign properties received', (function() { this._foreignPropertiesReceived = true; }).bind(this));
this.on('extension loaded', broadcastEvent.bind(this, 'extension loaded'));

@@ -68,5 +72,21 @@ this.on('configured', broadcastEvent.bind(this, 'configured'));

}, this);
this.emit('foreign properties received');
};
/**
* @param {Function} fn
*/
Worker.whenForeignPropertiesReceived = function(fn) {
return /** @this {Worker} */function() {
if (this._foreignPropertiesReceived) {
legacy.setImmediate(fn.bind(this));
} else {
this.once('foreign properties received', fn.bind(this));
}
return this;
};
};
/**
* `Require` application main script.

@@ -78,8 +98,12 @@ * Execution will be delayed until Worker became configured

*/
Worker.prototype.run = Worker.whenInitialized(function() {
require(this.config.resolve('app'));
Worker.prototype.run = Worker.whenInitialized(
Worker.whenForeignPropertiesReceived(function() {
var workerBase = this.config.resolve('app');
return this;
});
require(workerBase);
this.emit('worker loaded', workerBase);
return this;
}));
/**

@@ -86,0 +110,0 @@ * @override

2

package.json
{
"name" : "luster",
"version" : "0.5.2",
"version" : "0.5.3",
"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