Is there an equivalent of the <amb> operator with ...
# coroutines
j
Is there an equivalent of the amb operator with an array of
Flow
?
j
I was looking at this just before posting this message but I was not sure if that issue was relevant for suspend functions only and not flows.
j
Ah, sorry you're right. I'm not sure why I thought it was the Flow one.
e
j
i mean it's not that hard to do yourself. it's two launches with each collect and then the first cancels the other job. that's the best thing about coroutines and flow. you can write this operator yourself in like 10 lines of code and go look at the Rx impl and it'll be hundreds
😁 1
e
Evolution of software I guess
j
I did that at first yes, but I realize all I need is the first event of either flow, by using
first()
I converted them to coroutines and I was able to use Louis extension with the
select
keyword