2025-09-11 14:29:58 +08:00
|
|
|
|
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
|
2025-09-17 13:58:20 +08:00
|
|
|
|
public class HandleSendRunable implements Runnable {
|
2025-09-11 14:29:58 +08:00
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void run() {
|
2025-09-17 13:58:20 +08:00
|
|
|
|
|
2025-09-11 14:29:58 +08:00
|
|
|
|
while (!Thread.currentThread().isInterrupted()) {
|
|
|
|
|
|
try {
|
2025-09-17 13:58:20 +08:00
|
|
|
|
|
2025-09-11 14:29:58 +08:00
|
|
|
|
ResponseCmdInfo<?> response = Global.sendCmdInfoQueue.take();
|
|
|
|
|
|
WsServer.sendMessage(response.getScenarioId(), response.getRoom(), JSON.toJSONString(response));
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
log.error("error::", e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|