projectmoon
06/05/2019, 5:03 PMlauch { val result = async { doStuff() }.await() }, assuming doStuff() is a suspend fun? or would it make more sense to simply call doStuff() inside the launch block without async?Zach Klippenstein (he/him) [MOD]
06/05/2019, 5:20 PMdoStuff() inside launch, that async isn’t doing anything.projectmoon
06/05/2019, 5:27 PMprojectmoon
06/05/2019, 5:29 PMJason Ostrander
06/05/2019, 5:40 PMasync is used when you want to run code in parallelJason Ostrander
06/05/2019, 5:40 PMasync blocks, then await on both of the returned Deferredsprojectmoon
06/05/2019, 5:44 PMprojectmoon
06/05/2019, 5:45 PMDico
06/05/2019, 6:20 PMasync shouldnt be user very often at all, as a generale type of thumb.Dico
06/05/2019, 6:21 PMwithContext should commonly be used instead, when you invoke await immediately anyway