代码拉取完成,页面将自动刷新
package iotCommInitialize
import (
"gitee.com/fierce_wolf/go-fox-edge-common/commEntityManager"
"gitee.com/fierce_wolf/go-fox-edge-common/commEnv"
"gitee.com/fierce_wolf/go-fox-edge-common/commLogger"
"gitee.com/fierce_wolf/go-fox-edge-common/commRedis"
"gitee.com/fierce_wolf/go-fox-edge-common/commRedisStatus"
"gitee.com/fierce_wolf/go-fox-edge-common/commUtil/periodTask"
"gitee.com/fierce_wolf/go-fox-edge-iot-common/iotAPI"
"gitee.com/fierce_wolf/go-fox-edge-iot-common/iotRemote"
)
func Initialize() {
commEnv.SetWorkPath(2)
// 连接redis
commRedis.ConnectRedis()
// 检查连接状态:连接不上就通过panic退出吧
ok := commRedis.TestConnect()
if !ok {
panic("连接redis失败:" + commRedis.Options.Addr)
}
commLogger.Info("------------- iot-common-native 初始化开始!-------------")
// 启动状态线程
commRedisStatus.Instance()
commRedisStatus.Scheduler()
// 绑定已经实现的接口
iotAPI.EntityManager.InstanceFunc()
iotAPI.EntityManager.InitLoadEntityFunc()
// 将全局配置,读取到本地缓存中,方便后面反复使用,该方法必须在this.entityManageService.initLoadEntity()之后执行
iotAPI.LocalConfig.InitializeFunc()
// 远程通信组件的初始化
iotRemote.Initialize()
// 启动同步线程
commEntityManager.Scheduler()
// 启动周期线程
periodTask.Scheduler()
commLogger.Info("------------- iot-common-native 初始化结束!-------------")
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。