Matt Thiffault
10/21/2019, 7:55 PMoctylFractal
10/21/2019, 8:11 PMselect
?octylFractal
10/21/2019, 8:11 PMfor (c in list) c.onX {}
Matt Thiffault
10/21/2019, 8:12 PMMatt Thiffault
10/21/2019, 8:12 PMMatt Thiffault
10/21/2019, 8:13 PMoctylFractal
10/21/2019, 8:13 PMbdawg.io
10/21/2019, 9:45 PMval receivingA: SelectClause1<Foo> = channel.onReceive
select { // this: SelectBuilder<Foo>
receivingA { it }
}
The key thing is that you invoke
on the SelectClause returned by the onReceive
property from inside of the SelectBuilder
contextbdawg.io
10/21/2019, 9:46 PMinvoke
extension methods are found here in source: https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/common/src/selects/Select.kt#L20-L52