Interface AwaitableRunnable

    • Method Detail

      • hasTaskFinished

        boolean hasTaskFinished()
        Has the task finished?
        Returns:
        True if the task has finished.
      • awaitTaskCompletion

        boolean awaitTaskCompletion​(long amount,
                                    TimeUnit unit)
                             throws InterruptedException
        Block until the task has finished running, or until a timeout has expired.
        Parameters:
        amount - The duration of the timeout.
        unit - The units of the amount parameter.
        Returns:
        True if the task completed before the timeout expired; false if it did not.
        Throws:
        InterruptedException - If the thread was interrupted while waiting.