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

Dias

03/05/2019, 9:22 AM
When I want a function to run few coroutines in it I do
Copy code
fun test() = coroutineScope { 
   launch()
   launch() 
}
is using
Copy code
fun test() = withContext(...) { 
  launch()
  launch()
}
equivalent to that? apart from the part where you need to pass some context element in it
g

gildor

03/05/2019, 9:27 AM
yes, it’s mostly the same
and has the same semantics in terms of child coroutines
d

Dias

03/05/2019, 9:33 AM
ah! thank you
4 Views