/** Processes the listeners. */ private void processListeners() { while (!listeners.isEmpty()) { try { HttpPromiseListener<T> listener = listeners.poll(); if (executor != null) { executor.submit(new HttpPromiseTask<T>(listener, this)); } else { listener.handle(this); } } catch (Exception e) { logger.error("Unexpected error processing listener", e); } } }
/** @see java.lang.Runnable#run() */ public void run() { listener.handle(promise); }