at this time intellij is not honoring launch{} key...
# coroutines
j
at this time intellij is not honoring launch{} keyword from inside main
g
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
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
ok so the kotlinx githb project really lacks big bold letters saying add this to maven/gradle... iiuc
j
my bad, that's there...
g
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
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
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