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

Brian Dilley

05/02/2021, 9:23 PM
Given a collection of
Deferred<X>
- what’s the best way to retrieve their results as they come in - and at any point bail after receiving a result that you’re looking for while canceling the others?
a

Andrew Gazelka

05/02/2021, 9:27 PM
well this would definitely involve flows. I am not sure of an idiomatic way to do this, but there definitely might be!
e

ephemient

05/02/2021, 9:43 PM
select
or channels would make more sense then flows if you don't have flows to start with, I think
a

Andrew Gazelka

05/02/2021, 10:07 PM
@ephemient I thought channels were going to get deprecated in favor of hot flows? or is that just broadcastchannels
e

ephemient

05/03/2021, 1:23 AM
just BroadcastChannel, which isn't necessary here
2 Views