https://kotlinlang.org logo
#coroutines
Title
# coroutines
j

judrummer

01/22/2019, 4:08 AM
Which way is correct to make my suspend coroutine to be in same scope for calling coroutine scope?
g

gildor

01/22/2019, 4:09 AM
You don’t need coroutineScope for this case, so no reason to use it
j

judrummer

01/22/2019, 4:10 AM
It's auto bind to calling coroutineScope right ?
g

gildor

01/22/2019, 4:10 AM
function coroutineScope has completely different use case, when it has inside a few launched coroutine and they should have own scope and lifecycle but in this case there is no coroutines, only one suspend function suspendCoroutine which creates coroutine, but just a suspend function, so doesn’t require any scope
j

judrummer

01/22/2019, 4:11 AM
Many thanks. 😀
3 Views