onTimeout

fun <R> SelectBuilder<R>.onTimeout(timeMillis: Long, block: suspend () -> R)(source)

Clause that selects the given block after a specified timeout passes. If timeout is negative or zero, block is selected immediately.

Note: This is an experimental api. It may be replaced with light-weight timer/timeout channels in the future.

Parameters

timeMillis

timeout time in milliseconds.


fun <R> SelectBuilder<R>.onTimeout(timeout: Duration, block: suspend () -> R)(source)

Clause that selects the given block after the specified timeout passes. If timeout is negative or zero, block is selected immediately.

Note: This is an experimental api. It may be replaced with light-weight timer/timeout channels in the future.