public interface WaitableFuture
true is returned from one of the awaitXXX methods then the operation has completed. However,
the caller has to determine whether it was a successful or failed completion.| Modifier and Type | Method and Description |
|---|---|
default boolean |
await()
Wait
Long.MAX_VALUE msec. |
default boolean |
await(Duration timeout)
Wait for the asynchronous operation to complete with the specified timeout.
|
boolean |
await(long timeoutMillis)
Wait for the asynchronous operation to complete with the specified timeout.
|
default boolean |
await(long timeout,
TimeUnit unit)
Wait for the asynchronous operation to complete with the specified timeout.
|
default boolean |
awaitUninterruptibly()
Wait
Long.MAX_VALUE msec. |
default boolean |
awaitUninterruptibly(Duration timeoutMillis)
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
|
boolean |
awaitUninterruptibly(long timeoutMillis)
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
|
default boolean |
awaitUninterruptibly(long timeout,
TimeUnit unit)
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
|
Object |
getId() |
boolean |
isDone() |
Object getId()
toString() valuedefault boolean await()
throws IOException
Long.MAX_VALUE msec. for the asynchronous operation to complete. The attached listeners will be
notified when the operation is completed.true if the operation is completed.IOException - if failed - specifically InterruptedIOException if waiting was interruptedawait(long)default boolean await(long timeout,
TimeUnit unit)
throws IOException
timeout - The number of time units to waitunit - The TimeUnit for waitingtrue if the operation is completed.IOException - if failed - specifically InterruptedIOException if waiting was interruptedawait(long)default boolean await(Duration timeout) throws IOException
timeout - The maximum duration to wait, null to wait forevertrue if the operation is completed.IOException - if failed - specifically InterruptedIOException if waiting was interruptedawait(long)boolean await(long timeoutMillis)
throws IOException
timeoutMillis - Wait time in millisecondstrue if the operation is completed.IOException - if failed - specifically InterruptedIOException if waiting was interrupteddefault boolean awaitUninterruptibly()
Long.MAX_VALUE msec. for the asynchronous operation to complete uninterruptibly. The attached
listeners will be notified when the operation is completed.true if the operation is completed.awaitUninterruptibly(long)default boolean awaitUninterruptibly(long timeout,
TimeUnit unit)
timeout - The number of time units to waitunit - The TimeUnit for waitingtrue if the operation is completed.awaitUninterruptibly(long)default boolean awaitUninterruptibly(Duration timeoutMillis)
timeoutMillis - Wait time, null to wait forevertrue if the operation is finished.boolean awaitUninterruptibly(long timeoutMillis)
timeoutMillis - Wait time in millisecondstrue if the operation is finished.boolean isDone()
true if the asynchronous operation is completed. Note: it is up to the caller to
determine whether it was a successful or failed completion.Copyright © 2018–2020 The Apache Software Foundation. All rights reserved.