Interface ICompletionSync

    • Method Detail

      • isDone

        boolean isDone()
        Returns true if the task completed.

        Completion may be due to normal termination, an exception, or cancellation -- in all of these cases, this method will return true.

        Returns:
        true if the task completed
      • awaitCompletion

        void awaitCompletion()
        Waits if necessary for the associated task to complete.

        This method will re-throw any exception encountered during the execution of the task, possibly wrapped in a RuntimeException.

      • awaitCompletion

        void awaitCompletion​(long timeout,
                             TimeUnit unit)
                      throws TimeoutException
        Waits if necessary for at most the given time for the associated task to complete.

        This method will re-throw any exception encountered during the execution of the task, possibly wrapped in a RuntimeException.

        Reaching the timeout will cause the query tasks to be cancelled.

        Parameters:
        timeout - The maximum time to wait
        unit - The time unit of the timeout argument
        Throws:
        TimeoutException - if the wait timed out
      • awaitCompletion

        default void awaitCompletion​(Duration duration)
                              throws TimeoutException
        Waits if necessary for at most the given time for the associated task to complete.

        This method will re-throw any exception encountered during the execution of the task, possibly wrapped in a RuntimeException.

        Reaching the timeout will cause the query tasks to be cancelled.

        Parameters:
        duration - The maximum time to wait
        Throws:
        TimeoutException - if the wait timed out