MCPcopy Index your code
hub / github.com/nodejs/node / checkWaitingCount

Function checkWaitingCount

lib/internal/cluster/child.js:258–272  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

256 let waitingCount = 1;
257
258 function checkWaitingCount() {
259 waitingCount--;
260
261 if (waitingCount === 0) {
262 // If disconnect is worker initiated, wait for ack to be sure
263 // exitedAfterDisconnect is properly set in the primary, otherwise, if
264 // it's primary initiated there's no need to send the
265 // exitedAfterDisconnect message
266 if (primaryInitiated) {
267 process.disconnect();
268 } else {
269 send({ act: 'exitedAfterDisconnect' }, () => process.disconnect());
270 }
271 }
272 }
273
274 for (const handle of handles.values()) {
275 waitingCount++;

Callers 1

_disconnectFunction · 0.85

Calls 2

sendFunction · 0.70
disconnectMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…