Vladimir
03/31/2022, 8:50 PMRichard Gomez
03/31/2022, 8:53 PMasync { }
and then .await()
?
AggregatedResult(call1.await(), call2.await(), call3.await(), call4.await())
Joffrey
03/31/2022, 10:02 PMval result = coroutineScope {
val dbRes1 = async { call1() }
val dbRes2 = async { call2() }
...
AggregatedResult(
dbRes1.await(),
dbRes2.await(),
...
)
}
Joffrey
03/31/2022, 10:04 PMasync { .. }.await()
Vladimir
03/31/2022, 11:39 PMmcpiroman
04/07/2022, 11:51 AMasync
) to make it quicker. But recently I have found out that it is probably better, and has similar total query time, to not use coroutines but a single connection, start all queries first and then cyclically fetches one record from each ResultSet. I have not yet adopted this method but you may try it out too.