https://kotlinlang.org logo
#coroutines
Title
# coroutines
a

ahulyk

07/25/2019, 7:47 AM
Hi! I have a stupid question about coroutines. So we have Channels - hot streams and Flows - cold streams. The question is: if we converting Channel into Flow - we are getting kind of 'hot' Flow???
g

gildor

07/25/2019, 7:55 AM
Yes, you accessing hot channel using cold API, same with Subject in Rx
a

ahulyk

07/25/2019, 7:58 AM
@gildor thanks, cool 😎
@gildor in general overall idea and api looks just perfect 🙂 👌
g

gildor

07/25/2019, 8:24 AM
Also, soon we will get DataFlow (which is observable data holder with Flow API) which is essentially a hot Flow
so I wouldn’t focus too much on this, because it’s not so strict semantics, also should be clear separation between hot and cold nature of stream and API that used to consume it
👍 1
s

streetsofboston

07/25/2019, 11:59 AM
@gildor Would the introduction of DataFlow mean Channels may no longer be necessary? Or would they still be preferred for certain programming constructs?
g

gildor

07/25/2019, 12:02 PM
ConflatedBroadcastChannel will be not necessary (or at least I don't know other usecases for it, maybe some more specific), but other types of channels are important low level primitives (and used also for Flow, even in public API like callbackFlow)
s

streetsofboston

07/25/2019, 12:46 PM
Sorry, yes, I see the need for using them in low level implementations. But would they still be needed for higher level implementations, for app development?
g

gildor

07/25/2019, 1:55 PM
for own high level primitives, operators for flow etc
but probably not for everyone
Flow just safer and easier to use
s

streetsofboston

07/25/2019, 2:00 PM
👍
4 Views