@Override
public RESULT until(long timeout, TimeUnit unit, ExecutionCondition<RESULT> condition) throws ExecutionException,
TimeoutExecutionException {
CountDownWatch countdown = new CountDownWatch(timeout, unit);
Execution<RESULT> currentExecution = new FutureBasedExecution<RESULT>(service, executionTask, executionFuture);
// keep scheduling task until we have some time
while (countdown.timeLeft() > 0) {
Execution<RESULT> nextExecution = service.schedule(executionTask, pollInterval, pollUnit);
try {
RESULT result = currentExecution.awaitAtMost(countdown.timeLeft(), countdown.getTimeUnit());
if (condition.satisfiedBy(result)) {
// terminate execution of next callable
// we want to ignore failures in termination
try {
nextExecution.terminate();