diff .claude/skills/zenbu-seobeo-networking/SKILL.md @ 257:609d3c6aff4e

[seobeo] Add persistent SSE streams Co-authored-by: Copilot <[email protected]>
author MrJuneJune <me@mrjunejune.com>
date Tue, 04 Aug 2026 16:49:11 -0700
parents 745fd127b2a1
children
line wrap: on
line diff
--- a/.claude/skills/zenbu-seobeo-networking/SKILL.md	Tue Aug 04 16:49:01 2026 -0700
+++ b/.claude/skills/zenbu-seobeo-networking/SKILL.md	Tue Aug 04 16:49:11 2026 -0700
@@ -64,6 +64,27 @@
 Seobeo_WebSocket_Server_Register("/chat", Chat_Handler, NULL);
 ```
 
+Server-Sent Events:
+
+```c
+void Events(
+    Seobeo_SSE_Stream *p_stream,
+    Seobeo_Request_Entry *p_request,
+    Dowa_Arena *p_arena)
+{
+  Seobeo_SSE_Send_Data(p_stream, "ready");
+}
+
+Seobeo_Router_Register_SSE("/events", Events);
+```
+
+SSE handlers run once during connection setup and must return promptly. The
+stream may be retained for later thread-safe sends only through balanced
+`Seobeo_SSE_Retain` / `Seobeo_SSE_Release` calls; request/response arenas and
+request-map pointers expire when the handler returns. Check
+`Seobeo_SSE_Is_Open`, handle bounded backpressure, and use comments for
+heartbeats.
+
 Background work:
 
 ```c
@@ -98,6 +119,7 @@
 bazel test //seobeo:seobeo_client_test
 bazel test //seobeo:seobeo_websocket_test
 bazel test //seobeo:seobeo_websocket_server_test
+bazel test //seobeo/tests:seobeo_sse_test
 ```
 
 For API changes, also build downstream users: