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

jimn

11/23/2017, 5:22 AM
at this time intellij is not honoring launch{} keyword from inside main
g

gildor

11/23/2017, 5:25 AM
What do you mean? The only thing that you probably should do is wrap to
runBlocking{}
and call
join()
to wait when coroutine will be finished
Depends on your case of course, but there are no problems with launch, main and Idea as I know
intellij does not find a launch() that is kotlin in 1.2.-rc-39
g

gildor

11/23/2017, 5:27 AM
launch is not a part of stdlib, it’s function from library kotlinx.coroutines
Kotlin doesn’t provide any coroutines builders in stdlib and kotlinx.coroutines is just library that uses coroutines api to provide some high level primitives and api
j

jimn

11/23/2017, 5:28 AM
ok so the kotlinx githb project really lacks big bold letters saying add this to maven/gradle... iiuc
j

jimn

11/23/2017, 5:29 AM
my bad, that's there...
g

gildor

11/23/2017, 5:29 AM
ok so the kotlinx githb project really lacks big bold letters saying add this to maven/gradle... iiuc
what do you mean? There are big bold letters: https://github.com/Kotlin/kotlinx.coroutines#using-in-your-projects
j

jimn

11/23/2017, 5:31 AM
i broke this out into a seperate project and cleaned the pom and let intellij put the kotlin bits back in
it asked about adding coroutines so i thought it was done
g

gildor

11/23/2017, 5:34 AM
adding coroutines
It’s just enabled coroutine feature of compiler. kotlinx.coroutines is not requirement, you can use any implementation in your project, it’s easy to write simple coroutine builder for simple usage
3 Views