https://kotlinlang.org logo
Title
t

tseisel

06/07/2019, 12:35 PM
Does something like a hot
Flow
make sense, or is
Flow
dedicated to only cold asynchronous streams while `Channel`s are the best choice for hot streams ?
g

gildor

06/07/2019, 1:03 PM
You can convert channel to Flow, so it’s actually become hot
Also, there is proposal to reimplement BroadcastChannel using Flow interface, so it will be actually hot flow https://github.com/Kotlin/kotlinx.coroutines/issues/1082
a

Allan Wang

06/07/2019, 5:54 PM
@gildor how do you convert channels to flow? Or do you just mean bridging it with something like
flowViaChannel
?
g

gildor

06/07/2019, 6:07 PM
You can create flow from any BroadcastChannel
There is asFlow extension
flowViaChannel is not hot
Probably "convert" is not exactly correct, it's like subscribe on channel emissions using flow