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

Method RegisterOnClose

pkg/web/sse/ssehandler.go:320–324  ·  view source on GitHub ↗

RegisterOnClose registers a handler function to be called when the connection closes Returns an ID that can be used to unregister the handler

(fn func())

Source from the content-addressed store, hash-verified

318// RegisterOnClose registers a handler function to be called when the connection closes
319// Returns an ID that can be used to unregister the handler
320func (h *SSEHandlerCh) RegisterOnClose(fn func()) string {
321 h.lock.Lock()
322 defer h.lock.Unlock()
323 return h.onCloseHandlers.Register(fn)
324}
325
326// UnregisterOnClose removes a previously registered onClose handler by ID
327func (h *SSEHandlerCh) UnregisterOnClose(id string) {

Callers 1

RegisterToolApprovalFunction · 0.80

Calls 1

RegisterMethod · 0.80

Tested by

no test coverage detected