waitForCompletion

abstract fun waitForCompletion()

Blocks until the task is complete.


abstract fun waitForCompletion(duration: Long, timeUnit: TimeUnit?): Boolean

Blocks until the task is complete or times out.

Return

true if the task completed (has a result, an error, or was cancelled). false otherwise.