azabost
09/29/2023, 9:43 PMflow.emit(1)
?
fun main() = runBlocking {
val flow = MutableSharedFlow<Int>()
launch(<http://Dispatchers.IO|Dispatchers.IO>) {
flow.onEach { println(it) }.first()
}
flow.emit(1)
}
ephemient
09/29/2023, 9:44 PMazabost
09/29/2023, 9:45 PM1
?ephemient
09/29/2023, 9:47 PMephemient
09/29/2023, 9:47 PMazabost
09/29/2023, 9:48 PMephemient
09/29/2023, 9:48 PMlaunch(<http://Dispatchers.IO|Dispatchers.IO>, start = CoroutineStart.UNDISPATCHED) {
flow.onEach { println(it) }.first()
}
will happen to wait for the collector to suspend before launch
proceedsephemient
09/29/2023, 9:48 PMazabost
09/29/2023, 9:49 PMazabost
09/29/2023, 9:49 PMazabost
09/29/2023, 9:49 PM