|
@@ -12,13 +12,14 @@ import java.io.IOException;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.Optional;
|
|
import java.util.Optional;
|
|
|
|
+import java.util.concurrent.ConcurrentHashMap;
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class SSEService {
|
|
public class SSEService {
|
|
|
|
|
|
- private Map<Long, SseEmitter> sseMap = new HashMap<>();
|
|
|
|
- private Map<Long, SseEmitter> sseDataMap = new HashMap<>();
|
|
|
|
|
|
+ private Map<Long, SseEmitter> sseMap = new ConcurrentHashMap<>();
|
|
|
|
+ private Map<Long, SseEmitter> sseDataMap = new ConcurrentHashMap<>();
|
|
|
|
|
|
public void monitor(String token, SseEmitter sseEmitter) {
|
|
public void monitor(String token, SseEmitter sseEmitter) {
|
|
|
|
|