New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

think-cluster

Package Overview
Dependencies
Maintainers
5
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.2.0 to 1.3.0

17

lib/messenger.js

@@ -93,2 +93,3 @@ const cluster = require('cluster');

broadcast(action, data) {
assert(this.listenerCount(action) > 0, `can not find \`${action}\` listeners`);
process.send({

@@ -130,5 +131,12 @@ act: MESSENGER,

*/
consume(callback) {
assert(helper.isFunction(callback), 'callback must be a function');
const action = `think-messenger-${taskId++}`;
consume(action) {
if (helper.isFunction(action)) {
const callback = action;
action = `think-messenger-${taskId++}`;
this.once(action, callback);
// remove event callback after timeout, avoid memory leak
helper.timeout(10000).then(() => this.removeAllListeners(action));
} else {
assert(this.listenerCount(action) > 0, `can not find \`${action}\` listeners`);
}
process.send({

@@ -139,5 +147,2 @@ act: MESSENGER,

});
this.once(action, callback);
// remove event callback after timeout, avoid memory leak
helper.timeout(10000).then(() => this.removeAllListeners(action));
}

@@ -144,0 +149,0 @@ }

{
"name": "think-cluster",
"description": "Cluster manage for ThinkJS",
"version": "1.2.0",
"version": "1.3.0",
"author": {

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

@@ -15,2 +15,5 @@ const test = require('ava');

}
listenerCount(){
return 1;
}
emit() {}

@@ -83,3 +86,2 @@ }

const m = new Messenger();
m.broadcast(() => {}, 'test');

@@ -86,0 +88,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