Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
timeout | the maximum time to wait | |
unit | the time unit of the timeout argument |
CancellationException | if the computation was cancelled | |
ExecutionException | if the computation threw an exception | |
InterruptedException | if the current thread was interrupted while waiting | |
TimeoutException | if the wait timed out |
Diagram: Future