myanmarking
08/22/2019, 1:07 PMkingsley
08/22/2019, 1:12 PMfun CoroutineScope.someAsyncJobHere() = launch {
// some code
}
This function returns a Job
that you can then cancel (or not) latermyanmarking
08/22/2019, 1:13 PMfun startStepsSync(): CoroutineScope {
val scope = CoroutineScope(Dispatchers.Main)
scope.launch {
// something here
}
return scope
}
louiscad
08/22/2019, 1:34 PMCancellationException
).myanmarking
08/22/2019, 1:36 PMlouiscad
08/22/2019, 1:41 PMstreetsofboston
08/22/2019, 2:24 PM