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

cluster-client

Package Overview
Dependencies
Maintainers
15
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cluster-client - npm Package Compare versions

Comparing version 3.3.2 to 3.3.3

10

lib/server.js
'use strict';
const debug = require('debug')('cluster-client:server');
const debug = require('debug')('cluster-client:lib:server');
const net = require('net');

@@ -49,4 +49,4 @@ const Base = require('sdk-base');

return new Promise(resolve => {
debug('try to connecting port:%j', port);
const socket = net.connect(port, '127.0.0.1');
debug('try to connecting %s', port);
let success = false;

@@ -80,3 +80,3 @@ socket.on('connect', () => {

super();
debug('new ClusterServer(%j)', options);
this._sockets = new Map();

@@ -177,3 +177,5 @@ this._server = options.server;

if (instance && !instance.isClosed) {
debug('create %j instance exists', key);
if (typeSet.has(key)) {
debug('%j instance in typeSet', key);
return null;

@@ -184,2 +186,3 @@ }

}
debug('create %j instance not exists, try to create a new one with port: %j', key, port);
// compete for the local port, if got => leader, otherwise follower

@@ -193,2 +196,3 @@ try {

} catch (err) {
debug('create %j instance error: %s', key, err);
// if exception, that mean compete for port failed, then double check

@@ -195,0 +199,0 @@ instance = serverMap.get(port);

'use strict';
const debug = require('debug')('cluster-client');
const debug = require('debug')('cluster-client:lib:wrapper:base');
const is = require('is-type-of');

@@ -39,3 +39,5 @@ const Base = require('sdk-base');

constructor(options) {
options = options || {};
super(options);
debug('new WrapperBase({ port: %j, isLeader: %j })', options.port, options.isLeader);
this[subInfo] = new Map();

@@ -42,0 +44,0 @@ this[pubInfo] = new Map();

'use strict';
const debug = require('debug')('cluster-client');
const debug = require('debug')('cluster-client:lib:wrapper:cluster');
const Base = require('./base');

@@ -5,0 +5,0 @@ const Leader = require('../leader');

{
"name": "cluster-client",
"version": "3.3.2",
"version": "3.3.3",
"description": "Sharing Connection among Multi-Process Nodejs",

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

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