waitForCompletion

Blocks until the task is complete.


open 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.