1 Star 0 Fork 0

灵狐/go-fox-edge-iot-common

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
IotCommInitialize.go 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
灵狐 提交于 3个月前 . 提交代码
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 初始化结束!-------------")
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/fierce_wolf/go-fox-edge-iot-common.git
git@gitee.com:fierce_wolf/go-fox-edge-iot-common.git
fierce_wolf
go-fox-edge-iot-common
go-fox-edge-iot-common
v1.0.0

搜索帮助