liusuyi
2026-06-02 f652169cc5d6501511eece5df57b7b396fd7a7ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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);
    }
}