MCPcopy Create free account
hub / github.com/astercloud/aster / Stop

Method Stop

pkg/desktop/bridge_web.go:103–120  ·  view source on GitHub ↗

Stop stops the HTTP server

(ctx context.Context)

Source from the content-addressed store, hash-verified

101
102// Stop stops the HTTP server
103func (b *WebBridge) Stop(ctx context.Context) error {
104 if b.cancel != nil {
105 b.cancel()
106 }
107
108 // Close all SSE clients
109 b.sseMu.Lock()
110 for _, ch := range b.sseClients {
111 close(ch)
112 }
113 b.sseClients = make(map[string]chan *FrontendEvent)
114 b.sseMu.Unlock()
115
116 if b.server != nil {
117 return b.server.Shutdown(ctx)
118 }
119 return nil
120}
121
122// RegisterAgent registers an agent with the bridge
123func (b *WebBridge) RegisterAgent(ag *agent.Agent) error {

Callers

nothing calls this directly

Calls 2

cancelMethod · 0.45
ShutdownMethod · 0.45

Tested by

no test coverage detected