// If our listener was scheduled to run on an executor we may
// need to wait for our listener to finish running before the
// outputFuture has been constructed by the function.
long start = System.nanoTime();
if (!outputCreated.await(timeout, unit)) {
throw new TimeoutException();
}
timeout -= Math.max(0, System.nanoTime() - start);
// Like above with the inputFuture, we have a listener on
// the outputFuture that will set our own value when its