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

Function shared

lib/internal/cluster/child.js:144–159  ·  view source on GitHub ↗
(message, { handle, indexesKey, index }, cb)

Source from the content-addressed store, hash-verified

142
143// Shared listen socket.
144function shared(message, { handle, indexesKey, index }, cb) {
145 const key = message.key;
146 // Monkey-patch the close() method so we can keep track of when it's
147 // closed. Avoids resource leaks when the handle is short-lived.
148 const close = handle.close;
149
150 handle.close = function() {
151 send({ act: 'close', key });
152 handles.delete(key);
153 removeIndexesKey(indexesKey, index);
154 return ReflectApply(close, handle, arguments);
155 };
156 assert(handles.has(key) === false);
157 handles.set(key, handle);
158 cb(message.errno, handle);
159}
160
161// Round-robin. Master distributes handles across workers.
162function rr(message, { indexesKey, index }, cb) {

Callers 1

child.jsFile · 0.70

Calls 7

removeIndexesKeyFunction · 0.85
sendFunction · 0.70
deleteMethod · 0.65
hasMethod · 0.65
assertFunction · 0.50
cbFunction · 0.50
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…