1 package kotlinx.coroutines.selects 2 3 import kotlinx.coroutines.* 4 5 /** 6 * Loops while [select] expression returns `true`. 7 * 8 * The statement of the form: 9 * 10 * ``` 11 * whileSelect { 12 * /*body*/ 13 * } 14 * ``` 15 * 16 * is a shortcut for: 17 * 18 * ``` 19 * while(select<Boolean> { 20 * /*body*/ 21 * }) {} 22 * 23 * **Note: This is an experimental api.** It may be replaced with a higher-performance DSL for selection from loops. 24 */ 25 @ExperimentalCoroutinesApi whileSelectnull26public suspend inline fun whileSelect(crossinline builder: SelectBuilder<Boolean>.() -> Unit) { 27 while(select(builder)) { /* do nothing */ } 28 } 29