MCPcopy Create free account
hub / github.com/DNAProject/DNA / MessageRouter

Struct MessageRouter

p2pserver/message/utils/msg_router.go:37–43  ·  view source on GitHub ↗

MessageRouter mostly route different message type-based to the related message handler

Source from the content-addressed store, hash-verified

35// MessageRouter mostly route different message type-based to the
36// related message handler
37type MessageRouter struct {
38 msgHandlers map[string]MessageHandler // Msg handler mapped to msg type
39 RecvChan chan *types.MsgPayload // The channel to handle sync msg
40 stopRecvCh chan bool // To stop sync channel
41 p2p p2p.P2P // Refer to the p2p network
42 pid *actor.PID // P2P actor
43}
44
45// NewMsgRouter returns a message router object
46func NewMsgRouter(p2p p2p.P2P) *MessageRouter {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected