MCPcopy Create free account
hub / github.com/Cyinx/einx / handle_component_event

Method handle_component_event

module/module.go:264–278  ·  view source on GitHub ↗
(event_msg EventMsg)

Source from the content-addressed store, hash-verified

262}
263
264func (this *module) handle_component_event(event_msg EventMsg) {
265 com_event := event_msg.(*ComponentEventMsg)
266 c := com_event.Sender
267 if _, ok := this.component_map[c.GetID()]; ok == true {
268 slog.LogError("component", "module[%v] register component[%v]", this.name, c.GetID())
269 return
270 }
271 mgr := com_event.Attach.(ComponentMgr)
272 this.commgr_map[c.GetID()] = mgr
273 this.component_map[c.GetID()] = c
274 ctx := this.context
275 ctx.c = c
276 mgr.OnComponentCreate(ctx, c.GetID())
277 ctx.Reset()
278}
279
280func (this *module) handle_component_error(event_msg EventMsg) {
281 com_event := event_msg.(*ComponentEventMsg)

Callers 1

handle_eventMethod · 0.95

Calls 3

OnComponentCreateMethod · 0.80
GetIDMethod · 0.65
ResetMethod · 0.65

Tested by

no test coverage detected