Exerosis
05/30/2022, 12:54 AMval ctx = currentCoroutineContext()
val test = object : CoroutineScope {
override val coroutineContext = ctx
}
task = test.launch(context) { block() }
Not the same as:
coroutineScope {
task = launch(context)
}
I know the first one is bad practice so are they both pretty bad?ephemient
05/30/2022, 1:16 AMephemient
05/30/2022, 1:17 AMcoroutineScope {
task = launch { block() }
}
block()
is guaranteed to have completed when coroutineScope {}
returnsExerosis
05/30/2022, 2:14 AMZach Klippenstein (he/him) [MOD]
05/30/2022, 5:49 PM