await

Blocks until the build stops, then returns how it went.

Throws

whatever the pass failed with, rethrown here for the reason Maintenance.awaitIdle rethrows in the storage core: a failure nobody is told about is a failure nobody can act on. Read progress instead to inspect without throwing.


fun await(timeout: Long, unit: TimeUnit): Boolean

Blocks for at most timeouts.

Long and TimeUnit rather than a kotlin.time.Duration, which is what a Kotlin API written today would reach for first. Two reasons, and the second is the deciding one. This wraps Condition.awaitNanos and sits beside ExecutorService.awaitTermination, so it is the idiom a caller of either already has in hand. And Duration is a value class, so it mangles the JVM method nameawait-LRDsOJo — which would be the only such name in this project's published ABI and would not be callable from Java by any name a person would guess. Every other public signature here is plainly Java-callable, and a published ABI is the wrong place to make that stop being true.

Return

true if the build has stopped, false if it is still running. Does not rethrow — a caller polling with a timeout is asking whether it is done, and a timed wait that sometimes throws is awkward to write around. Check failure or call await.