sitepodmatt
02/14/2019, 4:23 AMgildor
02/14/2019, 4:35 AMsitepodmatt
02/14/2019, 5:00 AMgildor
02/14/2019, 5:20 AMgildor
02/14/2019, 5:21 AMsitepodmatt
02/14/2019, 6:01 AMgildor
02/14/2019, 6:16 AMgildor
02/14/2019, 6:17 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 finishgildor
02/14/2019, 6:17 AMsuspend fun CoroutineScope.createChangeStream() : ReceiveChannel<String> {
return produce<String> {
while(true) {
send("Changed")
delay(1000)
}
}
}
gildor
02/14/2019, 6:18 AM