onTimeout

abstract fun onTimeout(
    time: Long,
    unit: TimeUnit = TimeUnit.MILLISECONDS,
    block: suspend () -> R
): Unit
(source)

Platform and version requirements: JVM

Clause that selects the given block after a specified timeout passes.

Parameters

time - timeout time

unit - timeout unit (milliseconds by default)