bdawg.io
08/14/2018, 5:19 PMval result = async(myContext) { doSomething() }.await()
// vs
val result = withContext(myContext) { doSomething() }
igorvd
08/14/2018, 5:29 PMWithContext
the async
is useful for parallelism and to cancel the coroutinewithoutclass
08/14/2018, 5:35 PMwithContext
Vsevolod Tolstopyatov [JB]
08/14/2018, 6:01 PMwithContext
🙂igorvd
08/14/2018, 6:57 PMwithContext
.. What I remember is the docs encouraging you to use async-await
when you want an asynchronous resultelizarov
08/14/2018, 7:45 PMasync-await
for concurrent decomposition (do many async and wait for all them). If you want asynchronous result, you just invoke a suspending function.uli
08/14/2018, 7:51 PMrun
which was basically renamed to withContext
v0ldem0rt
08/14/2018, 7:59 PMelizarov
08/15/2018, 6:29 AM