R - The type of the return value.E - The exception type that the underlying implementation may throw.public interface AsyncGet<R,E extends java.lang.Throwable>
get(long, TimeUnit) method.
When the return value is still being computed, invoking
get(long, TimeUnit) will result in a TimeoutException.
The method should be invoked again and again
until the underlying computation is completed.| Modifier and Type | Interface | Description |
|---|---|---|
static class |
AsyncGet.Util |
Utility
|
| Modifier and Type | Method | Description |
|---|---|---|
R |
get(long timeout,
java.util.concurrent.TimeUnit unit) |
Get the result.
|
boolean |
isDone() |
R get(long timeout, java.util.concurrent.TimeUnit unit) throws E extends java.lang.Throwable, java.util.concurrent.TimeoutException, java.lang.InterruptedException
timeout - The maximum time period to wait.
When timeout == 0, it does not wait at all.
When timeout < 0, it waits indefinitely.unit - The unit of the timeout valueE - an exception thrown by the underlying implementation.java.util.concurrent.TimeoutException - if it cannot return after the given time period.java.lang.InterruptedException - if the thread is interrupted.E extends java.lang.Throwableboolean isDone()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.