MCPcopy
hub / github.com/plasma-umass/browsix / shared

Function shared

node/lib/cluster.js:570–583  ·  view source on GitHub ↗
(message, handle, cb)

Source from the content-addressed store, hash-verified

568
569 // Shared listen socket.
570 function shared(message, handle, cb) {
571 var key = message.key;
572 // Monkey-patch the close() method so we can keep track of when it's
573 // closed. Avoids resource leaks when the handle is short-lived.
574 var close = handle.close;
575 handle.close = function() {
576 send({ act: 'close', key: key });
577 delete handles[key];
578 return close.apply(this, arguments);
579 };
580 assert(handles[key] === undefined);
581 handles[key] = handle;
582 cb(message.errno, handle);
583 }
584
585 // Round-robin. Master distributes handles across workers.
586 function rr(message, cb) {

Callers 1

workerInitFunction · 0.85

Calls 3

sendFunction · 0.85
cbFunction · 0.70
assertFunction · 0.50

Tested by

no test coverage detected