ursus
03/29/2021, 9:50 PMfun intervalFlow(delayMillis: Long): Flow<Int> {
return flow {
withContext(Dispatchers.Default) {
var i = 0
emit(i)
while (true) {
delay(delayMillis)
emit(++i)
}
}
}
}
wrong -- I mean I read the article, but at runtime it doesnt crash, and printing threads in each step, seems correctlouiscad
03/30/2021, 9:12 AMflowOn
or replace flow
with channelFlow
.