Condition

object Condition

Condition An event-driven blocking utility. Frequencies are randomly adjusted to provide a basic antipattern.

Types

Check
Link copied to clipboard
abstract class Check : Callable<Boolean> , Filter<Void?>

Check A simplified conditional checking task.

Functions

sleep
Link copied to clipboard
fun sleep()

Sleeps the current thread for a duration that is 10 times the value of Random.getDelay.

fun sleep(ms: Int): Int

Sleeps the current thread.

wait
Link copied to clipboard
fun wait(cond: Callable<Boolean>): Boolean
fun wait(cond: () -> Boolean): Boolean
fun wait(cond: Callable<Boolean>, freq: Int, tries: Int): Boolean

Blocks until the specified condition is satisfied (returns true). This uses a frequency of 600ms for up to 10 tries, i.e. attempting a maximum of 6 seconds.

Properties

VARIANCE
Link copied to clipboard
val VARIANCE: DoubleArray

The random adjustment variance, 0.85-1.50.