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

Method Close

pkg/web/sse/ssehandler.go:350–364  ·  view source on GitHub ↗

Close closes the write channel, sends [DONE], and cleans up resources

()

Source from the content-addressed store, hash-verified

348
349// Close closes the write channel, sends [DONE], and cleans up resources
350func (h *SSEHandlerCh) Close() {
351 h.lock.Lock()
352 if h.closed || !h.initialized {
353 h.lock.Unlock()
354 return
355 }
356 h.closed = true
357
358 // Close the write channel, which will trigger [DONE] in writerLoop
359 close(h.writeCh)
360 h.lock.Unlock()
361
362 // Wait for writer goroutine to finish (without holding the lock)
363 h.wg.Wait()
364}
365
366// AI message writing methods
367

Callers 1

WriteErrorMethod · 0.95

Calls 1

WaitMethod · 0.65

Tested by

no test coverage detected