aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-09 13:33:57 +0300
committerGravatar Vitaly Takmazov2018-10-09 13:33:57 +0300
commit1da5c977fa3bed096cbcd9cdeccbe2930dc006ce (patch)
tree2cf3b525bb881f5ce92a7f997822a249edceff08 /juick-server/src/main/java/com
parent475c877892ca414bcbaf812a75d53cf455fe4539 (diff)
SSE: revert synchronization
Diffstat (limited to 'juick-server/src/main/java/com')
-rw-r--r--juick-server/src/main/java/com/juick/server/ServerManager.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/juick-server/src/main/java/com/juick/server/ServerManager.java b/juick-server/src/main/java/com/juick/server/ServerManager.java
index 4f25929b..fce92705 100644
--- a/juick-server/src/main/java/com/juick/server/ServerManager.java
+++ b/juick-server/src/main/java/com/juick/server/ServerManager.java
@@ -244,16 +244,14 @@ public class ServerManager implements NotificationListener {
public void sendSseEvent(Message msg, List<User> subscribers) {
List<EventSession> deadEmitters = new ArrayList<>();
- synchronized (this.getSessions()) {
- this.sessions.stream().filter(s -> subscribers.contains(s.user)).forEach(session -> {
- try {
- session.getEmitter().send(msg);
- } catch (Exception e) {
- deadEmitters.add(session);
- }
- });
- this.sessions.removeAll(deadEmitters);
- }
+ this.sessions.stream().filter(s -> subscribers.contains(s.user)).forEach(session -> {
+ try {
+ session.getEmitter().send(msg);
+ } catch (Exception e) {
+ deadEmitters.add(session);
+ }
+ });
+ this.sessions.removeAll(deadEmitters);
}
public static class EventSession {