add real-time infrastructure #137

Merged
talksik merged 6 commits from realtime-infra into master 2026-04-09 19:08:19 +00:00
2 changed files with 8 additions and 1 deletions
Showing only changes of commit 63eb6aa27f - Show all commits
+5 -1
View File
@@ -44,8 +44,12 @@ func (c *Conn) ReadPump(ctx context.Context, hub *Hub) {
return
}
// Ignore keep-alive pings
// Respond to keep-alive pings
if string(data) == "ping" {
if err := c.ws.Write(ctx, websocket.MessageText, []byte("pong")); err != nil {
slog.Debug("websocket pong write error", "connId", c.id, "error", err)
return
}
continue
}
+3
View File
@@ -176,6 +176,9 @@ export class PusherClient {
}
private handleMessage(data: string): void {
// Ignore keep-alive pong responses
if (data === "pong") return;
let msg: ServerMessage;
try {
msg = JSON.parse(data);