GenericValueWaiter

abstract class GenericValueWaiter<T>(initValue: T)

Abstract coroutine-based waiter that suspends until a monitored value satisfies a condition.

Subclasses define the satisfaction condition via monitorSatisfied. The value can be updated with checkCondition, which notifies any waiting coroutine when the condition is met.

Parameters

initValue

the initial value.

Type Parameters

T

the type of the monitored value.

Inheritors

Constructors

Link copied to clipboard
constructor(initValue: T)

Functions

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

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