void checkDelayedResponses() {
        try {
            long start = System.currentTimeMillis();
            log.log(Level.FINEST, () -> "Running DelayedResponseHandler. There are " + delayedResponses.size() +
                    " delayed responses. First one is " + delayedResponses.responses().peek());
            DelayedResponse response;
            while ((response = delayedResponses.responses().poll()) != null) {
                JRTServerConfigRequest request = response.getRequest();
                ConfigCacheKey cacheKey = new ConfigCacheKey(request.getConfigKey(), request.getRequestDefMd5());
                Optional<RawConfig> config = memoryCache.get(cacheKey);
                if (config.isPresent()) {
                    responseHandler.returnOkResponse(request, config.get());
                    sentResponses.incrementAndGet();
                } else {
                    log.log(Level.INFO, "Timed out (timeout " + request.getTimeout() + ") getting config " +
                            request.getConfigKey() + ", will retry");
                }
            }
            log.log(Level.FINEST, () -> "Finished running DelayedResponseHandler. " + sentResponses.get() +
                    " delayed responses sent in " + (System.currentTimeMillis() - start) + " ms");
        } catch (Exception e) {  // To avoid thread throwing exception and executor never running this again
            log.log(Level.WARNING, "Got exception in DelayedResponseHandler: " + Exceptions.toMessageString(e));
        } catch (Throwable e) {
            logAndDie("Got error in DelayedResponseHandler, exiting: " + Exceptions.toMessageString(e));
        }
    }
The run method of this class is executed periodically to return delayed responses
(requests use long polling, so config proxy needs to return a response when they time out).

@author hmusum
config-proxy/src/main/java/com/yahoo/vespa/config/proxy/DelayedResponseHandler.java