waitUntil
suspend fun waitUntil(timeoutDuration: Duration = Duration.INFINITE, predicate: (T) -> Boolean): Boolean
Suspends until predicate holds for the current value or timeoutDuration elapses.
The current value is checked first, so a condition that already holds returns true even for a zero timeout.
Return
true if the predicate was satisfied, false if the timeout expired.
Parameters
timeoutDuration
the maximum duration to wait. Defaults to Duration.INFINITE.
predicate
the condition to wait for.