feat(go-services): tracker share_* handlers (complete ingest) + shadow tuning
- share.go: cross-machine vital sharing (share_subscribe/unsubscribe/share_*), faithful port of the peer-state snapshot + plugin fan-out + /vital-sharing/peers. The last ingest handler — the Go tracker now handles every plugin event type. - shadow consumer: drop the outbound keepalive ping (the firehose is never idle) and tighten the read-deadline watchdog to 12s for faster reconnect after the upstream's periodic eviction (full-firehose browser clients get evicted ~every 90s; the watchdog recovers it, ~90% duty cycle). Production-bound /ws/position is unaffected (plugins connect to us; no eviction). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
27757636e4
commit
5b2db439a3
6 changed files with 171 additions and 27 deletions
|
|
@ -5,6 +5,7 @@ import (
|
|||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
)
|
||||
|
||||
// These endpoints are backed by ingest-only in-memory state in the Python
|
||||
|
|
@ -40,10 +41,15 @@ func (s *Server) handleQuestStatus(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
// GET /vital-sharing/peers (main.py:1800)
|
||||
func (s *Server) handleVitalSharingPeers(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, http.StatusOK, map[string]any{
|
||||
"peers": []any{},
|
||||
"subscriber_count": 0,
|
||||
if s.ingestor == nil {
|
||||
writeJSON(w, http.StatusOK, map[string]any{"peers": []any{}, "subscriber_count": 0})
|
||||
return
|
||||
}
|
||||
peers, subCount := s.ingestor.vitalSharingPeers()
|
||||
sort.Slice(peers, func(i, j int) bool {
|
||||
return toStr(peers[i]["character_name"]) < toStr(peers[j]["character_name"])
|
||||
})
|
||||
writeJSON(w, http.StatusOK, map[string]any{"peers": peers, "subscriber_count": subCount})
|
||||
}
|
||||
|
||||
// GET /equipment-cantrip-state/{name} (main.py:4167)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue