completeOnTimeout() method of CompletableFuture in Java
This method was introduced from Java 9.
|
1 |
CompletableFuture<T> completeOnTimeout(T value, long timeout, TimeUnit unit) |
This method is used to: if after a timeout period our task is still unfinished, instead of throwing out the TimeoutException exception like the orTimeout() method, our code will return the value that we passed in this method.… Read More



