package com.ard.work.websocket.config;
|
|
import com.ard.work.websocket.utils.PTZWebSocketUtils;
|
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.Resource;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 将 wsPushExecutor 静态注入 PTZWebSocketUtils,启用异步并行广播
|
*
|
* @author 刘苏义
|
*/
|
@Component
|
public class PTZWebSocketInitializer {
|
|
@Resource(name = "wsPushExecutor")
|
private ThreadPoolTaskExecutor wsPushExecutor;
|
|
@PostConstruct
|
public void init() {
|
PTZWebSocketUtils.setPushExecutor(wsPushExecutor);
|
}
|
}
|