feat: introduce middleware rabbitmq and redis
This commit is contained in:
@@ -2,6 +2,7 @@ package xin.merlin.myplayerbackend.utils.websocket;
|
||||
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.socket.CloseStatus;
|
||||
import org.springframework.web.socket.TextMessage;
|
||||
import org.springframework.web.socket.WebSocketSession;
|
||||
|
||||
@@ -37,5 +38,12 @@ public class WebSocketSessionManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void closeAll() {
|
||||
websocketSessions.forEach((uid, session) -> {
|
||||
try {
|
||||
session.close(CloseStatus.GOING_AWAY);
|
||||
} catch (Exception ignored) {}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user