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

Steven McLaughlin

10/29/2018, 6:03 PM
I have a (probably naive) question regarding coroutines. Since 1.3 is out and coroutines are no longer experimental, do I still need to add the kotlinx-coroutines-core bit in my gradle file if I want to write something simple like
Copy code
runBlocking {
            things.forEach {
                launch {
                    doTheThing(it)
                }
            }
        }
I wasn't sure if that was part of the base language now or not. I think I'm just a little confused about where the lines are drawn for this
r

Ruckus

10/29/2018, 6:05 PM
Yes. Coroutines are part of the language, but the functions
runBlocking
,
launch
, etc. are part of the kotlinx.coroutines library, so it will need to be included to use them.
s

Steven McLaughlin

10/29/2018, 6:05 PM
Okay cool. Thank you 🙂
👍 1
2 Views