public void run() { stopExecution(); } };
@Override public void onSuccess(ResultState state) { if(state != ResultState.SUCCESS) { if(runningListeners.decrementAndGet() == 0) { stopExecution(); } } }
@Override public void onFailure(Throwable throwable) { //check if other sockets are still running if(runningListeners.decrementAndGet() == 0) { stopExecution(); } } });