BooleanWaiter

A coroutine-based waiter that suspends until a boolean value changes.

Extends GenericValueWaiter to provide waitUntilTrue and waitUntilFalse convenience methods with optional timeout support.

Parameters

initValue

the initial boolean value.

Constructors

Link copied to clipboard
constructor(initValue: Boolean)

Functions

Link copied to clipboard
suspend fun checkCondition(value: Boolean)

Updates the value and then checks the condition to see if it's satisfied.

Link copied to clipboard
suspend fun setValue(value: Boolean)

Sets the boolean value and notifies any waiting coroutines if the condition is satisfied.

Link copied to clipboard
suspend fun waitUntilFalse(timeoutDuration: Duration = Duration.INFINITE): Boolean

Suspends until the value becomes false or the timeout expires.

Link copied to clipboard
suspend fun waitUntilTrue(timeoutDuration: Duration = Duration.INFINITE): Boolean

Suspends until the value becomes true or the timeout expires.