feat: add SSE streaming endpoint for workflow events (#33)
CI / CI (pull_request) Canceled after 14s

- New internal/temporal/sse.go: StreamWorkflowEvents handler
- Polls Temporal GetWorkflowExecutionHistory every 2s
- Maps Temporal event types to semantic SSE events
  (activity_started/completed/failed, workflow_completed, etc.)
- Heartbeat every 15s, clean close on workflow completion
- Route: GET /workflow/stream?workflow_id=X&namespace=default
- Added stream resource to workflow ServiceAdapter spec

Closes #33
This commit is contained in:
Admin Bot
2026-09-26 18:08:44 +08:00
parent bd8c64862c
commit f280415060
3 changed files with 239 additions and 0 deletions
+2
View File
@@ -67,6 +67,8 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.handleHealth(w, r)
case "/workflow/metrics":
h.handleMetrics(w, r)
case "/workflow/stream":
h.StreamWorkflowEvents(w, r)
default:
w.WriteHeader(http.StatusNotFound)
h.writeError(w, "", "NOT_FOUND", "Endpoint not found")