doMsgHandler immediately handles messages in a non-blocking manner (立即以非阻塞方式处理消息)
(request ziface.IRequest, workerID int)
| 318 | // doMsgHandler immediately handles messages in a non-blocking manner |
| 319 | // (立即以非阻塞方式处理消息) |
| 320 | func (mh *MsgHandle) doMsgHandler(request ziface.IRequest, workerID int) { |
| 321 | defer func() { |
| 322 | if err := recover(); err != nil { |
| 323 | zlog.Ins().ErrorF("workerID: %d doMsgHandler panic: %v", workerID, err) |
| 324 | } |
| 325 | }() |
| 326 | |
| 327 | msgId := request.GetMsgID() |
| 328 | handler, ok := mh.Apis[msgId] |
| 329 | |
| 330 | if !ok { |
| 331 | zlog.Ins().ErrorF("api msgID = %d is not FOUND!", request.GetMsgID()) |
| 332 | return |
| 333 | } |
| 334 | |
| 335 | // Bind the Request request to the corresponding Router relationship |
| 336 | // (Request请求绑定Router对应关系) |
| 337 | request.BindRouter(handler) |
| 338 | |
| 339 | // Execute the corresponding processing method |
| 340 | request.Call() |
| 341 | |
| 342 | // 执行完成后回收 Request 对象回对象池 |
| 343 | PutRequest(request) |
| 344 | } |
| 345 | |
| 346 | func (mh *MsgHandle) Execute(request ziface.IRequest) { |
| 347 | // Pass the message to the responsibility chain to handle it through interceptors layer by layer and pass it on layer by layer. |
no test coverage detected