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

Function registerController

pkg/blockcontroller/blockcontroller.go:97–112  ·  view source on GitHub ↗
(blockId string, controller Controller)

Source from the content-addressed store, hash-verified

95}
96
97func registerController(blockId string, controller Controller) {
98 var existingController Controller
99
100 registryLock.Lock()
101 existing, exists := controllerRegistry[blockId]
102 if exists {
103 existingController = existing
104 }
105 controllerRegistry[blockId] = controller
106 registryLock.Unlock()
107
108 if existingController != nil {
109 existingController.Stop(false, Status_Done, true)
110 wstore.DeleteRTInfo(waveobj.MakeORef(waveobj.OType_Block, blockId))
111 }
112}
113
114func deleteController(blockId string) {
115 registryLock.Lock()

Callers 1

ResyncControllerFunction · 0.85

Calls 3

StopMethod · 0.95
DeleteRTInfoFunction · 0.92
MakeORefFunction · 0.92

Tested by

no test coverage detected