2400 |
|
public <U> CompletableFuture<U> newIncompleteFuture() { |
2401 |
|
return new CompletableFuture<U>(); |
2402 |
|
} |
2403 |
+ |
|
2404 |
|
/** |
2405 |
|
* Returns the default Executor used for async methods that do not |
2406 |
|
* specify an Executor. This class uses the {@link |
2512 |
|
* @return this CompletableFuture |
2513 |
|
* @since 1.9 |
2514 |
|
*/ |
2515 |
< |
public CompletableFuture<T> completeOnTimeout(T value, long timeout, |
2515 |
> |
public CompletableFuture<T> completeOnTimeout(T value, long timeout, |
2516 |
|
TimeUnit unit) { |
2517 |
|
if (result == null) |
2518 |
|
whenComplete(new Canceller(Delayer.delay( |
2666 |
|
} |
2667 |
|
|
2668 |
|
/** Action to cancel unneeded timeouts */ |
2669 |
< |
static final class Canceller implements BiConsumer<Object, Throwable> { |
2669 |
> |
static final class Canceller implements BiConsumer<Object, Throwable> { |
2670 |
|
final Future<?> f; |
2671 |
|
Canceller(Future<?> f) { this.f = f; } |
2672 |
|
public void accept(Object ignore, Throwable ex) { |