MCPcopy Create free account
hub / github.com/cloudbase/garm / Unregister

Method Unregister

websocket/websocket.go:110–124  ·  view source on GitHub ↗
(client *Client)

Source from the content-addressed store, hash-verified

108}
109
110func (h *Hub) Unregister(client *Client) error {
111 if client == nil {
112 return nil
113 }
114 h.mux.Lock()
115 defer h.mux.Unlock()
116 cli, ok := h.clients[client.ID()]
117 if ok {
118 cli.Stop()
119 slog.DebugContext(h.ctx, "unregistering client", "client_id", cli.ID())
120 delete(h.clients, cli.ID())
121 slog.DebugContext(h.ctx, "current client count", "count", len(h.clients))
122 }
123 return nil
124}
125
126func (h *Hub) Write(msg []byte) (int, error) {
127 tmp := make([]byte, len(msg))

Callers 2

MetricsHandlerMethod · 0.45
WSHandlerMethod · 0.45

Calls 4

LockMethod · 0.65
UnlockMethod · 0.65
IDMethod · 0.65
StopMethod · 0.65

Tested by

no test coverage detected