Пример #1
0
func (self *ProtoProc) procCreateTopic(cmd protocol.Cmd, session *libnet.Session) error {
	log.Info("procCreateTopic")
	topicName := cmd.GetArgs()[0]
	serverAddr := cmd.GetAnyData().(string)
	self.Router.topicServerMap[topicName] = serverAddr

	return nil
}
Пример #2
0
func (self *ProtoProc) procStoreTopic(cmd protocol.Cmd, session *libnet.Session) error {
	glog.Info("procStoreTopic")
	var err error
	glog.Info(cmd.GetAnyData())
	err = self.Manager.topicStore.Set(cmd.GetAnyData().(*storage.TopicStoreData))
	if err != nil {
		glog.Error("error:", err)
	}
	glog.Info("set sesion id success")

	return nil
}
Пример #3
0
func (self *ProtoProc) procCacheTopic(cmd protocol.Cmd, session *libnet.Session) error {
	log.Info("procCacheTopic")
	var err error
	log.Info(cmd.GetAnyData())
	err = self.Manager.topicCache.Set(cmd.GetAnyData().(*redis_store.TopicCacheData))
	if err != nil {
		return err
		log.Error("error:", err)
	}
	log.Info("set sesion id success")

	return nil
}