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

think-cluster

Package Overview
Dependencies
Maintainers
8
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

think-cluster - npm Package Compare versions

Comparing version 1.5.3 to 1.5.4

14

lib/messenger.js

@@ -11,3 +11,4 @@ const cluster = require('cluster');

let taskId = 1;
// task counter
let count = 0;

@@ -48,7 +49,7 @@ /**

if (message.mapReturn) {
const map = mapPromise.get(message.action);
const map = mapPromise.get(`${message.action}_${message.taskId}`);
map.get(worker).resolve(message.data);
} else {
const map = new Map();
mapPromise.set(message.action, map);
mapPromise.set(`${message.action}_${message.taskId}`, map);
const promises = workers.map(worker => {

@@ -62,3 +63,3 @@ worker.send(message);

message.data = data;
message.action = `${message.action}_ret`;
message.action = `${message.action}_${message.taskId}_ret`;
worker.send(message);

@@ -110,5 +111,8 @@ });

const defer = helper.defer();
count = count % Number.MAX_SAFE_INTEGER + 1;
const taskId = count + '' + process.pid;
process.send({
act: MESSENGER,
action,
taskId,
mapData,

@@ -118,3 +122,3 @@ map: true,

});
this.once(`${action}_ret`, data => {
this.once(`${action}_${taskId}_ret`, data => {
defer.resolve(data);

@@ -121,0 +125,0 @@ mapPromise.delete(action);

{
"name": "think-cluster",
"description": "Cluster manage for ThinkJS",
"version": "1.5.3",
"version": "1.5.4",
"author": {

@@ -6,0 +6,0 @@ "name": "welefen",

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