New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RxJava 2 support #149
Comments
+1 |
Definitely! When is a bigger question; I haven't had a chance to even look at RxJava 2 yet, but since the first RC is out... |
@dlew :) I saw that 2.0 was released yesterday and I was so eager to try it :) It's good that RxLifecycle is the only Rx dependency in my list that needs to be ported. Let's hope I can find a little time so I can help with the porting. |
Because I needed RxLifecycle to support 2.x, I’ve released this interop-wrapper library as a workaround until you release a version of RxLifecycle supporting natively 2.x. https://github.com/VictorAlbertos/RxLifecycleInterop If you were willing to provide some guidelines about how to perform the migration, I would be happy to contribute to the porting :) |
A start would be to create a branch for RxJava2 support and allow others to send you PR's to do the initial grunt work. However, first there probably needs to be some decisions on how it would be packaged and distributed. RxJava2 is designed to coexist beside RxJava1 to allow gradual transitions to it. Should RxLifeCycle for RxJava2 also support coexisting beside RxLifecycle for RxJava1 and what would that even look like? |
I'll start working on a side branch for RxJava 2 soon (as in next week). People are demanding it so it must happen, even if it's sooner than I want. I'll look into the possibility of the two existing side-by-side. One problem with that is adding to the method limit. Another is signing us up for long-term support of RxJava 1 (that I probably don't want to do). But maybe it won't be so bad. |
One complication is that Completable has no takeUntil operator in RxJava2. Maybe they named it something else, but it may be a semantic thing. What should the Completable do if the event occurs? call on Completed? call on Error? Neither seems right. So am I correct in that RxLifecycle when it gets the event for an Observable, it simply completes the Observable (i.e. calls onCompleted on the subscriber) instead of just unsubscribes? |
You can check out the current code for how it handles And yes, you are correct. The problem with calling unsubscribe is that it actually is not guaranteed to work, depending on how operators are setup. It is abnormal for an operator to call unsubscribe, in other words. It'll work going upstream but not necessarily downstream. |
@dlew the big advantage of already adding support for RxJava 2 now is that you still have the chance of changing the API. (E.g. the transformer change) Once the stable release is out it'll be much harder. |
I see there is actually a discussion on this very topic: ReactiveX/RxJava#4646 |
FYI, RxJava 2.0 was released today |
+1 |
I've been working on RxLifecycle v2 which supports RxJava 2. A snapshot release is now available on the Sonatype snapshots repository: https://github.com/trello/RxLifecycle/tree/2.x#installation You can read up on what's changed (so far) here: https://github.com/trello/RxLifecycle/blob/2.x/CHANGELOG.md#20-unreleased I'm going to be letting this (and Navi) sit for a week so people can review/test it out. Then I'll push an official 2.0 next week. |
Hi, are you planning include RxJava 2 support?
The text was updated successfully, but these errors were encountered: