jcechace
10/29/2018, 4:56 PMasync
calls into coroutineScope {}
to inherit the coroutine scope from the calling function (e.g. main)?louiscad
10/29/2018, 4:59 PMasync
(for parallelization inside one coroutine mainly), then don't use it, and prefer withContext
and launch
depending on the use case.diesieben07
10/29/2018, 4:59 PMCoroutineScope
(that way any launched coroutines are attached to that scope).
If you have a suspending function that also launches coroutines you need coroutineScope
to inherit your own coroutine scope (the one that the suspending function is called with) to those coroutines.suspend
function and not use launch
, etc. then you do not need coroutineScope
as far as I understand it.jcechace
10/29/2018, 5:01 PMcoroutineScope
only if the function uses async
or launch
. Could you link the talk you are referring to please? Would watch!