LameBooleanWaiter

A coroutine-based waiter that suspends until its boolean value toggles.

Call waitForChangeInValue to suspend until the value flips from its current state, and changeValue to update the value and notify any waiting coroutine.

Parameters

value

the initial boolean value.

Constructors

Link copied to clipboard
constructor(value: Boolean)

Functions

Link copied to clipboard
suspend fun changeValue(newValue: Boolean)

Updates the boolean value and notifies waiting coroutines if the value changes.

Link copied to clipboard
suspend fun waitForChangeInValue()

Suspends until the boolean value changes to the opposite of the current value.