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

serebit

04/19/2019, 10:40 PM
Only thing I’m missing with Flow is the ability to add to a flow that has a terminal operator running
o

octylFractal

04/19/2019, 10:41 PM
why can't you just make the source take from a Channel or something?
s

serebit

04/19/2019, 10:41 PM
Could do, but wouldn’t that defeat the point of a cold stream by stapling a cold stream onto a hot one?
o

octylFractal

04/19/2019, 10:42 PM
you can do the same thing with a flow
but you can't "add" to that
and really, a
Channel
that's constructed manually isn't really a producer
s

serebit

04/19/2019, 10:45 PM
I did have the idea of using a list whose iterator will update with elements added during iteration, and then creating a flow out of that list
o

octylFractal

04/19/2019, 10:46 PM
that's essentially what I'm suggesting, but with the thread-safe Channel mechanism
3 Views