// See https://github.com/Atmosphere/atmosphere/issues/1590
// Better to call onDisconnect that onResume.
if (allowedToClose) {
if (ff || closingTime > 0) {
completeLifecycle = false;
logger.debug("Delaying closing operation for firefox and resource {}", resource.uuid());
ExecutorsFactory.getScheduler(framework.getAtmosphereConfig()).schedule(new Callable<Object>() {
@Override
public Object call() throws Exception {
executeClose(webSocket, 1005);
finish(webSocket, resource, r, s, !allowedToClose);