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

voben

06/13/2019, 12:52 AM
Trying to figure out what
coroutineScope
function is doing. How come we can’t hit
myDeferred2
line without waiting 7secs. Shouldn’t myDeferred2 get scheduled as soon as
myDeferred1
is suspended?
Copy code
viewModelScope.launch {

            val myDeferred1 = coroutineScope {
                delay(7000)
            }
            val myDeferred2 = coroutineScope {
                delay(2000)
            }
}
p

Paulius Ruminas

06/13/2019, 8:40 AM
https://github.com/Kotlin/kotlinx.coroutines/issues/1103 A lot of people are confused by the naming of this function.
2 Views