MCPcopy
hub / github.com/wavetermdev/waveterm / SSEHandlerCh

Struct SSEHandlerCh

pkg/web/sse/ssehandler.go:66–80  ·  view source on GitHub ↗

SSEHandlerCh provides channel-based Server-Sent Events functionality

Source from the content-addressed store, hash-verified

64
65// SSEHandlerCh provides channel-based Server-Sent Events functionality
66type SSEHandlerCh struct {
67 w http.ResponseWriter
68 rc *http.ResponseController
69 ctx context.Context // the r.Context()
70 writeCh chan SSEMessage
71
72 lock sync.Mutex
73 closed bool
74 initialized bool
75 err error
76
77 wg sync.WaitGroup
78 onCloseHandlers utilds.IdList[func()]
79 handlersRun bool
80}
81
82// MakeSSEHandlerCh creates a new channel-based SSE handler
83func MakeSSEHandlerCh(w http.ResponseWriter, ctx context.Context) *SSEHandlerCh {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected