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

richodemus

08/29/2018, 8:25 AM
Anyone have a list of all the functions that are added for coroutines? (like async, runBlocking etc) or know where I can find it I find that it's something I'm missing when trying to learn them, to kinda answer the question "is there a better way of doing this?"
g

gildor

08/29/2018, 8:27 AM
the only keyword is
suspend
. Async, runBlocking just function names and not even part of stdlib
r

richodemus

08/29/2018, 8:28 AM
That's why I put keyword in quotes, I mean the coroute-related functions as well
I updated my question to avoid confusion
g

gildor

08/29/2018, 8:29 AM
language part of coroutines is very small and low level (except maybe buildSequence and buildIterator): https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines.experimental/index.html
But there is also kotlinx.coroutines which is official library from Kotlin Team that build a lot of more high level primitives and integrations on top of Kotlin coroutines, you can find full references and docs on Github page of the library: https://github.com/Kotlin/kotlinx.coroutines
r

richodemus

08/29/2018, 8:38 AM
After much digging I found this: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/ which is the closest to what I was looking for
g

gildor

08/29/2018, 8:45 AM
Yes, this is reference of kotlinx-coroutines-core module, but there are many other: https://kotlin.github.io/kotlinx.coroutines/
But if you want to learn how to use Kotlinx.Coroutines and Coroutines in general better to read this guide first which includes examples of usage of many of those primitives and some usecases and approaches: https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md
r

richodemus

08/29/2018, 9:17 AM
That was a nice guide, thanks
3 Views