simulation-backend/src/main/java/com/hivekion/thread/HandleSendRunable.java
wangwenhua e02e19c2d1 天气
2025-09-21 11:57:12 +08:00

36 lines
749 B
Java

package com.hivekion.thread;
import com.alibaba.fastjson.JSON;
import com.hivekion.Global;
import com.hivekion.common.entity.ResponseCmdInfo;
import com.hivekion.ws.WsServer;
import lombok.extern.slf4j.Slf4j;
/**
* [类的简要说明]
* <p>
* [详细描述,可选]
* <p>
*
* @author LiDongYU
* @since 2025/7/22
*/
@Slf4j
public class HandleSendRunable implements Runnable {
@Override
public void run() {
while (!Thread.currentThread().isInterrupted()) {
try {
ResponseCmdInfo<?> response = Global.sendCmdInfoQueue.take();
WsServer.sendMessage(response.getScenarioId(), response.getRoom(), JSON.toJSONString(response));
} catch (Exception e) {
log.error("error::", e);
}
}
}
}