MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / runOnCloseHandlers

Method runOnCloseHandlers

pkg/web/sse/ssehandler.go:334–347  ·  view source on GitHub ↗

runOnCloseHandlers runs all registered onClose handlers exactly once

()

Source from the content-addressed store, hash-verified

332
333// runOnCloseHandlers runs all registered onClose handlers exactly once
334func (h *SSEHandlerCh) runOnCloseHandlers() {
335 h.lock.Lock()
336 if h.handlersRun {
337 h.lock.Unlock()
338 return
339 }
340 h.handlersRun = true
341 h.lock.Unlock()
342
343 handlers := h.onCloseHandlers.GetList()
344 for _, fn := range handlers {
345 fn()
346 }
347}
348
349// Close closes the write channel, sends [DONE], and cleans up resources
350func (h *SSEHandlerCh) Close() {

Callers 1

writerLoopMethod · 0.95

Calls 1

GetListMethod · 0.80

Tested by

no test coverage detected