Skip to content
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

Closed
FuriousSeraphim opened this issue Aug 28, 2016 · 14 comments
Closed

RxJava 2 support #149

FuriousSeraphim opened this issue Aug 28, 2016 · 14 comments
Milestone

Comments

@FuriousSeraphim
Copy link

Hi, are you planning include RxJava 2 support?

@bobymicroby
Copy link

+1

@dlew
Copy link
Contributor

dlew commented Aug 29, 2016

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...

@bobymicroby
Copy link

@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.

@VictorAlbertos
Copy link

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 :)

@dalewking
Copy link

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?

@dlew
Copy link
Contributor

dlew commented Oct 6, 2016

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.

@dalewking
Copy link

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?

@dlew
Copy link
Contributor

dlew commented Oct 6, 2016

You can check out the current code for how it handles Completable. Basically it ends with onCompleted() via amb(). I'm not sure that's the correct behavior but it seems better than ending with onError.

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.

@vanniktech
Copy link
Contributor

@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.

@dalewking
Copy link

I see there is actually a discussion on this very topic: ReactiveX/RxJava#4646

@dalewking
Copy link

FYI, RxJava 2.0 was released today

@huseyinozer
Copy link

+1

@dlew
Copy link
Contributor

dlew commented Nov 2, 2016

@huseyinozer https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments

@dlew dlew modified the milestone: RxJava2 Nov 2, 2016
@dlew
Copy link
Contributor

dlew commented Nov 8, 2016

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.

@dlew dlew closed this as completed Nov 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants