SSE reconnect, task switcher state/inbox/new task, stream throttle

This commit is contained in:
Ian Gulliver
2026-10-14 22:28:25 -07:00
parent 8e4c40eb5f
commit 33e682a9d5
27 changed files with 418 additions and 182 deletions
+2 -2
View File
@@ -48,7 +48,7 @@ func (s *Server) StreamEvents(w http.ResponseWriter, r *http.Request, params api
return
}
ping := time.NewTicker(30 * time.Second)
ping := time.NewTicker(15 * time.Second)
defer ping.Stop()
for {
@@ -68,7 +68,7 @@ func (s *Server) StreamEvents(w http.ResponseWriter, r *http.Request, params api
}
case <-ping.C:
_, err := fmt.Fprint(w, ": ping\n\n")
_, err := fmt.Fprint(w, "event: ping\ndata: ping\n\n")
if err != nil {
return
}