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
When an AtmosphereResource gets destroyed because of a disconnect, we always loops in search for reference to all Broadcaster in DefaultBroadcasterFactory
@OverridepublicvoidremoveAllAtmosphereResource(AtmosphereResourcer) {
// Remove inside all Broadcaster as well.try {
if (store.size() > 0) {
for (Broadcasterb : lookupAll()) {
try {
b.removeAtmosphereResource(r);
} catch (IllegalStateExceptionex) {
logger.trace(ex.getMessage(), ex);
}
}
}
} catch (Exceptionex) {
logger.warn(ex.getMessage(), ex);
}
}
When there are thousand of Broadcaster created, this creates a performance botteneck. It would be better to associate a list of Broadcaster to an AtmosphereResource in that case, and make sure when a Broadcaster is destroyed it is also removed from that list.
The text was updated successfully, but these errors were encountered:
jfarcand
changed the title
[Performance] Avoid looping and removing an AtmosphereResource from all available Broadcaster
[Performance] Avoid looping and removing an AtmosphereResource from all available Broadcasters
Mar 4, 2015
When an
AtmosphereResource
gets destroyed because of a disconnect, we always loops in search for reference to allBroadcaster
inDefaultBroadcasterFactory
When there are thousand of
Broadcaster
created, this creates a performance botteneck. It would be better to associate a list ofBroadcaster
to anAtmosphereResource
in that case, and make sure when aBroadcaster
is destroyed it is also removed from that list.The text was updated successfully, but these errors were encountered: