Merge branch '45-solve-concurrency-issues-with-socket-updates-from-sensorsocket' into 'dev'
Resolve "Solve concurrency issues with socket updates from SensorSocket" Closes #45 See merge request sa4-2020/the-sanmarinoes/backend!57
This commit is contained in:
commit
c8121d8473
1 changed files with 2 additions and 2 deletions
|
@ -58,9 +58,9 @@ public class SensorSocketEndpoint extends Endpoint {
|
||||||
* @return number of successful transfer
|
* @return number of successful transfer
|
||||||
*/
|
*/
|
||||||
public long broadcast(Object message, User u) {
|
public long broadcast(Object message, User u) {
|
||||||
final Collection<Session> sessions = authorizedClients.get(u);
|
final HashSet<Session> sessions = new HashSet<>(authorizedClients.get(u));
|
||||||
|
|
||||||
return sessions.stream()
|
return sessions.stream()
|
||||||
.parallel()
|
|
||||||
.filter(
|
.filter(
|
||||||
s -> {
|
s -> {
|
||||||
if (s.isOpen()) return true;
|
if (s.isOpen()) return true;
|
||||||
|
|
Loading…
Reference in a new issue