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

Struct MsgHandle

znet/msghandler.go:23–50  ·  view source on GitHub ↗

MsgHandle is the module for handling message processing callbacks (对消息的处理回调模块)

Source from the content-addressed store, hash-verified

21// MsgHandle is the module for handling message processing callbacks
22// (对消息的处理回调模块)
23type MsgHandle struct {
24 // A map property that stores the processing methods for each MsgID
25 // (存放每个MsgID 所对应的处理方法的map属性)
26 Apis map[uint32]ziface.IRouter
27
28 // The number of worker goroutines in the business work Worker pool
29 // (业务工作Worker池的数量)
30 WorkerPoolSize uint32
31
32 // A collection of idle workers, used for zconf.WorkerModeBind
33 // 空闲worker集合,用于zconf.WorkerModeBind
34 freeWorkers map[uint32]struct{}
35 freeWorkerMu sync.Mutex
36
37 // A message queue for workers to take tasks
38 // (Worker负责取任务的消息队列)
39 TaskQueue []chan ziface.IRequest
40
41 // A collection of extra workers, used for zconf.WorkerModeDynamicBind
42 // (池里的工作线程不够用的时候, 可临时额外分配workerID集合, 用于zconf.WorkerModeDynamicBind)
43 extraFreeWorkers map[uint32]struct{}
44 extraFreeWorkerMu sync.Mutex
45
46 // Chain builder for the responsibility chain
47 // (责任链构造器)
48 builder *chainBuilder
49 RouterSlices *RouterSlices
50}
51
52// newMsgHandle creates MsgHandle
53// zinxRole: IServer

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected