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

Dalinar

01/16/2019, 4:24 PM
ah ok, I was thinking there might be major reworking of code needed..
g

gildor

01/16/2019, 4:27 PM
Nope, there is almost no work (only fix new warnings if you want), but in general it should be backward compatible But migration of old coroutines may be not so straight forward
d

Dalinar

01/16/2019, 4:28 PM
what is old coroutines? what version is old?
g

gildor

01/16/2019, 4:29 PM
I'm talking about Kotlinx.coroutines library
Versions after 0.26 introduced a lot of changes, such as Structured concurrency
But in general it's more about library update, not language itself. But it requires If you use some old version of kotlinx.coroutines and want to migrate to 1.3
g

groostav

01/16/2019, 6:58 PM
Nope, there is almost no work (only fix new warnings if you want),
this is not accurate if you're on a version of kotlinx.coroutines prior to 0.26. As you mentioned, the structured coroutines change is not small. Cancellation semantics are different, and I got a bunch
implementation should be intrinsic
errors from
suspendCoroutineOrReturn
, as that function seems effectively depricated and scheduled for removal sooner rather than later.
g

gildor

01/16/2019, 11:43 PM
@groostav yes, and I mentioned this on my next message, that it's not so easy with very old kotlinx.coroutines
d

Dalinar

01/17/2019, 7:19 AM
ok I'm a little confused, my import packages start with kotlinx.coroutines.experimental, so that is not what you guys are talking about, right? my coroutine usage code is only from 2017.. for me it should be little effort to upgrade to the latest, correct?
g

gildor

01/17/2019, 7:20 AM
this is kotlinx.coroutines with experimental package, correct. Which version do you use?
d

Dalinar

01/17/2019, 7:21 AM
how can I check the version?
g

gildor

01/17/2019, 7:21 AM
Check version of dependency
org.jetbrains.kotlinx:kotlinx-coroutines-*
d

Dalinar

01/17/2019, 7:22 AM
org.jetbrains.kotlinx:kotlinx-coroutines-core:jar:0.22.5
so if it seems to work, better for me to leave it alone for now?
g

gildor

01/17/2019, 7:26 AM
I would recommend migrate
d

Dalinar

01/17/2019, 7:26 AM
yes I would do that eventually, I was just trying to determine if i needed to do this soon
g

gildor

01/17/2019, 7:26 AM
but it will be not so straight forward
Biggest difference is strucutred concurrency https://github.com/Kotlin/kotlinx.coroutines/releases/tag/0.26.0
d

Dalinar

01/17/2019, 7:27 AM
I'm not entirely sure what that is, I'll have to read up on it
I use coroutines mostly with
future { }
in my kotlin code
I also have some javascript code with coroutines but I don't know when I will need that again, are there much changes in regards to them with javascript?
g

gildor

01/17/2019, 7:28 AM
Even to use with future you need CoroutineScope now
6 Views