CUB-136: add SSE endpoint in Go backend #41
Reference in New Issue
Block a user
Delete Branch "agent/dex/CUB-136-sse-endpoint"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds the SSE endpoint
GET /api/eventsfor real-time updates in the Go backend.Files
internal/sse/broadcaster.go— Channel-based event fan-out to connected clientsinternal/sse/events.go— Event types (printer.status, job.started, job.completed, filament.low) and payloadsinternal/sse/handler.go— HTTP handler with graceful disconnect via request contextinternal/router/router.go— Wire SSE endpoint, per-route timeout to exclude SSEcmd/server/main.go— Broadcaster lifecycle (Start/Stop), WriteTimeout=0 for SSEKey design decisions
Subscribe()Broadcaster.Stop()drains remaining events, closes all client channelsLinear
Closes CUB-136
APPROVED
Clean implementation. Merge when ready.