Interface WaitableFuture

    • Method Detail

      • getId

        Object getId()
        Returns:
        Some identifier useful as toString() value
      • await

        boolean await​(long timeoutMillis,
                      CancelOption... options)
               throws IOException
        Wait for the asynchronous operation to complete with the specified timeout.
        Parameters:
        timeoutMillis - Wait time in milliseconds
        options - Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.
        Returns:
        true if the operation is completed.
        Throws:
        IOException - if failed - specifically InterruptedIOException if waiting was interrupted
      • awaitUninterruptibly

        default boolean awaitUninterruptibly​(CancelOption... options)
        Wait Long.MAX_VALUE msec. for the asynchronous operation to complete uninterruptibly. The attached listeners will be notified when the operation is completed.
        Parameters:
        options - Optional CancelOptions defining the behavior on time-out; ignored if the future is not Cancellable.
        Returns:
        true if the operation is completed.
        See Also:
        awaitUninterruptibly(long, CancelOption[])
      • awaitUninterruptibly

        default boolean awaitUninterruptibly​(long timeout,
                                             TimeUnit unit,
                                             CancelOption... options)
        Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
        Parameters:
        timeout - The number of time units to wait
        unit - The TimeUnit for waiting
        options - Optional CancelOptions defining the behavior on time-out; ignored if the future is not Cancellable.
        Returns:
        true if the operation is completed.
        See Also:
        awaitUninterruptibly(long, CancelOption[])
      • awaitUninterruptibly

        default boolean awaitUninterruptibly​(Duration timeoutMillis,
                                             CancelOption... options)
        Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
        Parameters:
        timeoutMillis - Wait time, null to wait forever
        options - Optional CancelOptions defining the behavior on time-out; ignored if the future is not Cancellable.
        Returns:
        true if the operation is finished.
      • awaitUninterruptibly

        boolean awaitUninterruptibly​(long timeoutMillis,
                                     CancelOption... options)
        Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
        Parameters:
        timeoutMillis - Wait time in milliseconds
        options - Optional CancelOptions defining the behavior on time-out; ignored if the future is not Cancellable.
        Returns:
        true if the operation is finished.
      • isDone

        boolean isDone()
        Returns:
        true if the asynchronous operation is completed. Note: it is up to the caller to determine whether it was a successful or failed completion.