void () { try { while (true) { Computable<Boolean> next = myQueue.poll(30, TimeUnit.MILLISECONDS); if (next != null && !next.compute()) { tryReadOrCancel(indicator, () -> indicator.addDelayedMiddleMatches()); return; } indicator.checkCanceled(); } } catch (InterruptedException e) { LOG.error(e); } }