@Component public class RedisTopicRespondDeviceService extends PeriodTaskService
| 构造器和说明 |
|---|
RedisTopicRespondDeviceService() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
execute(long threadId)
执行任务
步骤:
1.获取全局设备列表和操作列表,进行循环遍历操作
2.从全局设备配置中,获得设备的配置参数
3.将操作请求编码后发送给设备,并对设备返回的数据进行解码,得到设备的各项数值
4.将设备的各项数值,写入redis保存,通过redis分享给其他服务
说明:SyncQueueObjectMap.inst().popup默认waite了100毫秒,所以不再需要专门的sleep(100)
|
schedule, schedulepublic void execute(long threadId)
throws Exception
说明:SyncQueueObjectMap.inst().popup默认waite了100毫秒,所以不再需要专门的sleep(100)
execute 在类中 PeriodTaskServiceException - 异常情况Copyright © 2024. All rights reserved.