is there a difference between: 1- calling a norma...
# coroutines
r
is there a difference between: 1- calling a normal function from a coroutine scope
Copy code
fun foo(){ // do something}
coroutineScope.launch{ foo }
2 - calling suspend function from a coroutine scope
Copy code
suspend fun foo(){ // do something}
coroutineScope.launch{ foo }
h
In this sample: there is no difference. Only use suspend modifier, if you need it need it because you call other suspend functions. The compiler adds a continuation parameter for each call which could be optimized if the function does not need it at all. Also you cant call a
suspend fun
from Java (if you need it)
💡 2
👍 1