Files
ArmedPolice/app/init.go

24 lines
689 B
Go
Raw Permalink Normal View History

2021-11-02 09:43:19 +08:00
package app
import (
2021-11-02 16:22:07 +08:00
"ArmedPolice/app/event"
"ArmedPolice/app/service"
"ArmedPolice/config"
2021-11-08 11:09:27 +08:00
"ArmedPolice/utils"
2021-11-02 09:43:19 +08:00
)
func Init() {
2021-11-08 11:09:27 +08:00
// 启动SocketHub
go utils.TryCatch(func() {
service.NewHub().Run()
})
2021-11-04 16:16:57 +08:00
// 载入数据配置
2021-11-24 09:08:07 +08:00
utils.LoadConfig("./json/area.json", &config.SettingAreaInfo)
2021-11-02 09:43:19 +08:00
// 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())
}