SelectBuilder

sealed interface SelectBuilder<in R>(source)

Scope for select invocation.

An instance of SelectBuilder can only be retrieved as a receiver of a select block call, and it is only valid during the registration phase of the select builder. Any uses outside it lead to unspecified behaviour and are prohibited.

The general rule of thumb is that instances of this type should always be used implicitly and there shouldn't be any signatures mentioning this type, whether explicitly (e.g. function signature) or implicitly (e.g. inferred val type).

Functions

Link copied to clipboard
abstract operator fun SelectClause0.invoke(block: suspend () -> R)

Registers a clause in this select expression without additional parameters that does not select any value.

abstract operator fun <Q> SelectClause1<Q>.invoke(block: suspend (Q) -> R)

Registers clause in this select expression without additional parameters that selects value of type Q.

open operator fun <P, Q> SelectClause2<P?, Q>.invoke(block: suspend (Q) -> R)

Registers clause in this select expression with additional nullable parameter of type P with the null value for this parameter that selects value of type Q.

abstract operator fun <P, Q> SelectClause2<P, Q>.invoke(param: P, block: suspend (Q) -> R)

Registers clause in this select expression with additional parameter of type P that selects value of type Q.

Link copied to clipboard
open fun onTimeout(timeMillis: Long, block: suspend () -> R)

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

Link copied to clipboard
fun <R> SelectBuilder<R>.onTimeout(timeMillis: Long, block: suspend () -> R)

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

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

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

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

"java.time" adapter method for SelectBuilder.onTimeout.