mng
06/16/2022, 4:59 PMval callA = async { the call }
val callB = async { the call }
if (callA.await().isSuccess) {
callB.cancel()
return callA.await()
}else {
callA.cancel()
return callB.await()
}
However, it doesn’t quite get the behavior I want because I’m essentially only waiting for Call A to complete first before I even check on Call B. Can anyone offer some advice, please?Adam Powell
06/16/2022, 5:07 PMselect {}
and Deferred.onAwait {}
jw
06/16/2022, 5:10 PMNick Allen
06/16/2022, 5:12 PMmerge(::suspendMethod1.asFlow(), ::suspendMethod2.asFlow()).first()
Adam Powell
06/16/2022, 5:13 PMmng
06/16/2022, 5:30 PM