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

Method handle_rpc

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

Source from the content-addressed store, hash-verified

315}
316
317func (this *module) handle_rpc(event_msg EventMsg) {
318 rpc_msg := event_msg.(*RpcEventMsg)
319 if handler, ok := this.rpc_handler_map[rpc_msg.RpcName]; ok == true {
320 ctx := this.context
321 ctx.s = rpc_msg.Sender
322 handler(ctx, rpc_msg.Data)
323 ctx.Reset()
324 } else {
325 slog.LogError("module", "module [%v] unregister rpc handler! rpc name:[%v]", this.name, rpc_msg.RpcName)
326 }
327 event_msg.Reset()
328 this.rpc_msg_pool.Put(rpc_msg)
329}

Callers 1

handle_eventMethod · 0.95

Calls 2

ResetMethod · 0.65
PutMethod · 0.45

Tested by

no test coverage detected