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

Function broadcast

benchmark/cluster/echo.js:50–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48 }
49
50 function broadcast() {
51 if (broadcasts++ === n) {
52 bench.end(n);
53 for (const id in cluster.workers)
54 cluster.workers[id].disconnect();
55 return;
56 }
57 for (const id in cluster.workers) {
58 const worker = cluster.workers[id];
59 for (let i = 0; i < sendsPerBroadcast; ++i)
60 worker.send(data);
61 }
62 }
63
64 function onMessage() {
65 if (++msgCount === expectedPerBroadcast) {

Callers 2

onOnlineFunction · 0.70
onMessageFunction · 0.70

Calls 3

disconnectMethod · 0.65
sendMethod · 0.65
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…