mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
cluster: move handle tracking out of utils
internal/cluster/utils.js exported a handles object, which was used in a test. That test, test-cluster-disconnect-handles.js, was removed in https://github.com/nodejs/node/pull/12495. This commit moves the handles object to the only file in the codebase that still uses it. PR-URL: https://github.com/nodejs/node/pull/23131 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
e7b6589a7c
commit
47a0a0b503
@ -7,7 +7,7 @@ const EventEmitter = require('events');
|
||||
const RoundRobinHandle = require('internal/cluster/round_robin_handle');
|
||||
const SharedHandle = require('internal/cluster/shared_handle');
|
||||
const Worker = require('internal/cluster/worker');
|
||||
const { internal, sendHelper, handles } = require('internal/cluster/utils');
|
||||
const { internal, sendHelper } = require('internal/cluster/utils');
|
||||
const { ERR_SOCKET_BAD_PORT } = require('internal/errors').codes;
|
||||
const keys = Object.keys;
|
||||
const cluster = new EventEmitter();
|
||||
@ -19,6 +19,7 @@ const [ minPort, maxPort ] = [ 1024, 65535 ];
|
||||
|
||||
module.exports = cluster;
|
||||
|
||||
const handles = new Map();
|
||||
cluster.isWorker = false;
|
||||
cluster.isMaster = true;
|
||||
cluster.Worker = Worker;
|
||||
|
@ -3,8 +3,7 @@ const util = require('util');
|
||||
|
||||
module.exports = {
|
||||
sendHelper,
|
||||
internal,
|
||||
handles: new Map() // Used in tests.
|
||||
internal
|
||||
};
|
||||
|
||||
const callbacks = new Map();
|
||||
|
Loading…
Reference in New Issue
Block a user