You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: msgdispatcher.go
    path of file: ./repos/cellnet/proc
    
    the code of the file until where you have to start completion: package proc

import (
	"github.com/davyxu/cellnet"
	"reflect"
	"sync"
)

// 消息派发器，可选件，兼容v3以前的注册及派发消息方式，在没有代码生成框架及工具时是较方便的接收处理接口
type Me
    
func (self *MessageDispatcher) OnEvent(ev cellnet.Event) {

	msgType := reflect.TypeOf(ev.Message())

	if msgType == nil {
		return
	}

	self.handlerByTypeGuard.RLock()
	handlers, ok := self.handlerByType[msgType.Elem()]
	self.handlerByTypeGuard.RUnlock()

	if ok {

		for _, callback := range handlers {

			callback(ev)
		}

	}
}