You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
activeClients.put(clientId, now);
if (isAtmosphereResourceValid(r)) {//todo better to have cacheLost flag/** * This line is called for each AtmosphereResource (note that * broadcaster.getAtmosphereResources() may not return the current AtmosphereResource because * the resource may be destroyed by DefaultBroadcaster.executeAsyncWrite or JerseyBroadcasterUtil * concurrently, that is why we need to check duplicates), * * Cache the message only once for the clients * which are not currently connected to the server */Broadcasterbroadcaster = getBroadCaster(r.getAtmosphereConfig(), broadcasterId);
List<AtmosphereResource> resources = newArrayList<AtmosphereResource>(broadcaster.getAtmosphereResources());
Set<String> disconnectedClients = getDisconnectedClients(resources);
for (StringdisconnectedId : disconnectedClients) {
addMessageIfNotExists(disconnectedId, cacheMessage);
}
} else {
/** * Cache lost message, caching only for specific client. * Preventing duplicate inserts because this method can be called * concurrently from DefaultBroadcaster.executeAsyncWrite or JerseyBroadcasterUtil * when calling cacheLostMessage */addMessageIfNotExists(clientId, cacheMessage);
}
The code above is wrong, e.g messages MUST always be cached => so the disconnect logic must be removed
The text was updated successfully, but these errors were encountered:
The code above is wrong, e.g messages MUST always be cached => so the disconnect logic must be removed
The text was updated successfully, but these errors were encountered: