MCPcopy Index your code
hub / github.com/srcbookdev/srcbook / send

Method send

packages/web/src/clients/websocket/client.ts:64–74  ·  view source on GitHub ↗
(topic: string, event: string, payload: Record<string, any>)

Source from the content-addressed store, hash-verified

62 }
63
64 private send(topic: string, event: string, payload: Record<string, any>) {
65 const message = JSON.stringify([topic, event, payload]);
66
67 if (this.socket && this.open) {
68 this.socket.send(message);
69 } else {
70 console.error(
71 `Attempting to send a message to a socket with readyState '${this.humanReadyState()}'. This is a bug in WebSocketClient.\n\nMessage:\n${message}`,
72 );
73 }
74 }
75
76 private humanReadyState() {
77 switch (this.socket?.readyState) {

Callers 3

pushMethod · 0.95
flushMethod · 0.95
configureServerFunction · 0.80

Calls 1

humanReadyStateMethod · 0.95

Tested by

no test coverage detected