Package kotlinx.coroutines.experimental.selects
Platform and version requirements: JVM
Select expression to perform multiple suspending operations simultaneously until one of them succeeds.
Types
interface SelectBuilder<in R> Scope for select invocation. |
|
interface SelectClause0 Clause for select expression without additional parameters that does not select any value. |
|
interface SelectClause1<out Q> Clause for select expression without additional parameters that selects value of type Q. |
|
interface SelectClause2<in P, out Q> Clause for select expression with additional parameter of type P that selects value of type Q. |
Functions
suspend fun <R> select( Waits for the result of multiple suspending functions simultaneously, which are specified using clauses in the builder scope of this select invocation. The caller is suspended until one of the clauses is either selected or fails. |
|
suspend fun <R> selectUnbiased( Waits for the result of multiple suspending functions simultaneously like select, but in an unbiased way when multiple clauses are selectable at the same time. |
|
suspend fun whileSelect( Loops while select expression returns |