Files
ArmedPolice/app/init.go
2021-11-24 09:08:07 +08:00

24 lines
689 B
Go

package app
import (
"ArmedPolice/app/event"
"ArmedPolice/app/service"
"ArmedPolice/config"
"ArmedPolice/utils"
)
func Init() {
// 启动SocketHub
go utils.TryCatch(func() {
service.NewHub().Run()
})
// 载入数据配置
utils.LoadConfig("./json/area.json", &config.SettingAreaInfo)
// RedisHash存储/移除监听
service.Subscribe(config.EventForRedisHashProduce, event.NewRedisHashProduce())
service.Subscribe(config.EventForRedisHashDestroy, event.NewRedisHashDestroy())
// RedisList存储/移除监听
service.Subscribe(config.EventForRedisListProduce, event.NewRedisListProduce())
service.Subscribe(config.EventForRedisListDestroy, event.NewRedisListDestroy())
}