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

serebit

10/10/2018, 5:52 PM
are coroutines going to be merged into the standard library (kotlin-stdlib) for the 1.3 release, or will they remain a separate artifact?
e

elizarov

10/10/2018, 5:54 PM
support for coroutines in the Kotlin language is part of stdlib.
kotlinx.coroutines
library will remain a separate artifact and will be released in a stable version
1.0.0
together with Kotlin
1.3.0
.
s

serebit

10/10/2018, 5:55 PM
Yeah, that's what I meant. Thanks!
t

tw

10/10/2018, 5:56 PM
@elizarov sorry this may seem silly but what exactly do you mean by that?
e

elizarov

10/10/2018, 5:57 PM
Exactly what I’ve said. What part of that need clarification? Can you elaborate your question, please?
s

serebit

10/10/2018, 6:13 PM
@tw The Kotlin standard library has support for, but no implementation of, coroutines. The implementation is provided by the
kotlinx.coroutines
libraries. My question was, will the implementation be merged into the standard library? And the answer is, according to @elizarov, that the implementation of coroutines will stay outside of the standard library. Does that answer your question?
e

elizarov

10/10/2018, 6:19 PM
To be fair,
sequence { ... }
coroutine builder is a part of stdlib. You can write and use suspending functions anywhere — that is fully supported by Kotlin (the language) and its standard library. You can start new coroutines via
startCoroutine
using just stdlib.
However, you’ll need
kotlinx.coroutines
library for higher-level features like cancellation, so `launch`/`async` (which support cancellation and structured concurrency) are part of
kotllinx.coroutines
.
t

tw

10/10/2018, 6:28 PM
AHH this makes sense
I wanted to fully understand the difference between stdlib and the dependency
s

serebit

10/10/2018, 6:55 PM
I do have one more question @elizarov: is there any particular reason why
runBlocking
isn't in
coroutines-core-common
?
e

elizarov

10/10/2018, 6:56 PM
Yes. It cannot be implemented in JS.
s

serebit

10/10/2018, 6:57 PM
Gotcha, thanks. 👍
e

elizarov

10/10/2018, 6:57 PM
You cannot block JS event thread.
3 Views