Does `Flow` have a corresponding `select` clause, ...
# coroutines
t
Does
Flow
have a corresponding
select
clause, and if it doesn't, is it planned ?
o
what would you want to
select
on? I suppose
single
might make sense, but it's still an extension based on
collect
, so
collect
would need to be selectable, but
collect
doesn't really seem like a good idea for it
t
I'd like to receive simultaneously from the
ReceiveChannel
of an
actor
and the items emitted by a
Flow
. Should I convert my
Flow
to a
ReceiveChannel
with
Flow.produceIn
in order to use the
onReceive
clause ?
o
that sounds like a better option
I think
select
in general doesn't make sense for Flow -- it's a cold stream, so it won't start until you consume it, but you won't start consuming it until you call
collect
, and if you
select
, you're technically not consuming it, so it will never be started
👍 2
g
Another option is convert channel yo Flow and use combineLatest operator
👍 1