sitepodmatt
02/14/2019, 4:23 AMgildor
02/14/2019, 4:35 AMsitepodmatt
02/14/2019, 5:00 AMgildor
02/14/2019, 5:20 AMsitepodmatt
02/14/2019, 6:01 AMgildor
02/14/2019, 6:16 AMcoroutineScope{}
is special kind of scope builder that created to use as suspend function, but it just cannot be used with produce inside, because design to suspend until all child coroutines will finishsuspend fun CoroutineScope.createChangeStream() : ReceiveChannel<String> {
return produce<String> {
while(true) {
send("Changed")
delay(1000)
}
}
}