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

aaverin

11/05/2018, 10:47 AM
Hey everybody! Wasn’t there a converter from Coroutines to RxJava1? I can’t seem to find it, I thought it will be here https://github.com/Kotlin/kotlinx.coroutines/tree/master/reactive
e

elizarov

11/05/2018, 10:54 AM
a

aaverin

11/05/2018, 10:56 AM
There are many projects with legacy rx1 code that might want to use libraries, that are written with Kotlin coroutines. As a library creator, I need to provide interop layer
Would be great to have an officially supported converter
e

elizarov

11/05/2018, 10:58 AM
Even authors of Rx1.x don’t support it anymore, so we decided that we should not either.
a

aaverin

11/05/2018, 11:03 AM
That’s sad. Not everybody has time for a migration to Rx2
Would it be possible to bring back Rx1 integration module for such legacy apps support reasons? There are still actively supported libraries for Rx2-Rx1 interoperabilty, for the same reason
Module could still be non-supported in terms of updates, but could serve to kickstart a custom implementation, or could be just a drop-in solution for legacy apps
e

elizarov

11/05/2018, 11:08 AM
GitHub remembers everything. You can take the old sources & adapt them for the recent changes. Alternatively. you can can take current sources of Rx2 integration and adapter them for Rx1.
If all you need are things like
.awaitFirst()/.awaitLast()/.awaitSingle()
extension functions on
Observable
, then it is not a lot of code and works only on top of stable public API.
a

aaverin

11/05/2018, 11:09 AM
I am asking from community perspective, rather then just for myself
e

elizarov

11/05/2018, 11:11 AM
We are short of hands too. Our reasoning went like this: If there is a project still using Rx1 (which went dead quite a while ago), the it is likely that is simply not maintained, so there are little changes it is going be migrated to coroutines either
a

aaverin

11/05/2018, 11:18 AM
I see. Not sure how many people will have the same, but our case is basically – we have modern app, and a legacy app, that are supposed to use same set of libraries We write those libraries ourselves using latest stack, so, on coroutines. We were planning to provide a set of artifacts for rx1 and rx2 support, so that other apps could just use it Because Rx1 is officially not supported, there will be no maintenance cost in keeping coroutine-rx1 converter, I think
e

elizarov

11/05/2018, 11:41 AM
It is costly for us while we are evolving our internal APIs. Some limited support we could have provide though. Will think.
g

gildor

11/05/2018, 11:51 AM
I still think that it doesn't make sense for kotlinx.coroutines support it. Legacy projects will exist forever, but supporting deprecated library for such actively evolving library as Kotlinx.coroutines is just waste of time for Kotlin libraries team, better use this time for something more useful If someone wants to use it, just extract to a separate project and support if you have resources for that Many popular RxJava related libraries already dropped support of Rx1 or never had it (for example Room)
Also, see reactions to this message Looks that not so many adopters of rx1 in this channel https://kotlinlang.slack.com/archives/C1CFAFJSK/p1537523527000100?thread_ts=1537523527.000100&cid=C1CFAFJSK
a

aaverin

11/05/2018, 12:16 PM
Looks like artefact 0.24.0 is still available on maven, so until we migrate to Kotlin 1.3 we are probably safe with the outdated converter
l

louiscad

11/05/2018, 12:37 PM
I think a solution would be to link the old rx1 sources in the docs where rx2 is linked (using tag of latest version supporting it).
👍 1
k

kenkyee

11/05/2018, 5:53 PM
can't you use the Rx1->Rx2 interop library? You'd have to do multiple interops for what you want, but it should work fine. I used the Rx1->Rx2 interop while I did the migration...hit something like 300 files w/ all the changes because our app is fairly large 😞
5 Views