MCPcopy Index your code
hub / github.com/github/awesome-copilot / broadcast

Function broadcast

extensions/java-modernization-studio/server.mjs:52–63  ·  view source on GitHub ↗
(rec, payload)

Source from the content-addressed store, hash-verified

50
51/** Write an SSE payload to every connected client of an instance. */
52export function broadcast(rec, payload) {
53 const data = "data: " + JSON.stringify(payload) + "\n\n";
54 for (const res of rec.sseClients) {
55 try {
56 res.write(data);
57 } catch {
58 // Client disconnected uncleanly: drop it so we don't keep throwing on
59 // every future broadcast (dead clients would otherwise leak in the Set).
60 rec.sseClients.delete(res);
61 }
62 }
63}
64
65/** Re-scan the repo and push the fresh snapshot to connected clients. */
66export async function pushState(rec, log, opts) {

Callers 4

cockpit.test.mjsFile · 0.90
pushStateFunction · 0.70
startAutopilotFunction · 0.70
dispatchActionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected