MCPcopy
hub / github.com/aceld/zinx / SendMsgToTaskQueue

Method SendMsgToTaskQueue

znet/msghandler.go:299–305  ·  view source on GitHub ↗

SendMsgToTaskQueue sends the message to the TaskQueue for processing by the worker (将消息交给TaskQueue,由worker进行处理)

(request ziface.IRequest)

Source from the content-addressed store, hash-verified

297// SendMsgToTaskQueue sends the message to the TaskQueue for processing by the worker
298// (将消息交给TaskQueue,由worker进行处理)
299func (mh *MsgHandle) SendMsgToTaskQueue(request ziface.IRequest) {
300 workerID := request.GetConnection().GetWorkerID()
301 // zlog.Ins().DebugF("Add ConnID=%d request msgID=%d to workerID=%d", request.GetConnection().GetConnID(), request.GetMsgID(), workerID)
302 // Send the request message to the task queue
303 mh.TaskQueue[workerID] <- request
304 zlog.Ins().DebugF("SendMsgToTaskQueue-->%s", hex.EncodeToString(request.GetData()))
305}
306
307// doFuncHandler handles functional requests (执行函数式请求)
308func (mh *MsgHandle) doFuncHandler(request ziface.IFuncRequest, workerID int) {

Callers 1

InterceptMethod · 0.95

Calls 5

InsFunction · 0.92
GetWorkerIDMethod · 0.65
GetConnectionMethod · 0.65
DebugFMethod · 0.65
GetDataMethod · 0.65

Tested by

no test coverage detected