messages are being received on both ends now!

This commit is contained in:
2026-04-21 22:41:27 -05:00
parent dd88667d73
commit c834c11bc8
4 changed files with 33 additions and 3 deletions
+16
View File
@@ -1,6 +1,7 @@
package reactivity
import (
"log/slog"
"sync"
)
@@ -56,3 +57,18 @@ func (t *Tracker) GetQuerySubscriptions(queryHash string) []string {
}
return subscriptionIDs
}
func (t *Tracker) SendMessage(clientID string, message []byte) {
t.mu.RLock()
defer t.mu.RUnlock()
client := t.clients[clientID]
if client == nil {
slog.Error("Tracker: Client not found", "clientID", clientID)
return
}
select {
case client.Send <- message:
default:
slog.Error("Tracker: Client send channel is full", "clientID", clientID)
}
}