Coder Social home page Coder Social logo

RxJava support about tmdb-java HOT 8 OPEN

uwetrottmann avatar uwetrottmann commented on May 27, 2024
RxJava support

from tmdb-java.

Comments (8)

SimonVT avatar SimonVT commented on May 27, 2024 1

Having separate RxMoviesService, etc, classes and an optional dependency on RxJava would probably not cause any issues for existing users tho

from tmdb-java.

sevar83 avatar sevar83 commented on May 27, 2024 1

I've pushed a fork with support for Kotlin and RxJava2. But it's built as an Android Gradle library not a pure Java artifact.
https://github.com/sevar83/tmdb-rxjava2-kotlin

from tmdb-java.

serafo27 avatar serafo27 commented on May 27, 2024 1

I created a fork, and relative pull request, in wich i duplcated all the services that return Observables.
All the new Services can be found into the class Tmdb.rx

https://github.com/serafo27/tmdb-rxjava

from tmdb-java.

urizev avatar urizev commented on May 27, 2024

No need since Retrofit2 already supports RxJava. Indeed, it supports every interface through call adapters

Add this library:

compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'

And extend the Tmdb class to add the support.

class RxTmdb extends Tmdb {
      protected Retrofit.Builder retrofitBuilder() {
        return super.retrofitBuilder().
                         .addCallAdapterFactory(RxJava2CallAdapterFactory.create());
     }
}

from tmdb-java.

UweTrottmann avatar UweTrottmann commented on May 27, 2024

@urizev But you still would have to change all the service method return types, no? Like:

@GET("search/movie")
Call<MovieResultsPage> movie(...);

has to be changed to:

@GET("search/movie")
Observable<MovieResultsPage> movie(...);

@NathHorrigan In any case, you should create a fork of this library and make the necessary adjustments (find/replace return types, add call adapter). Adding any possible RxJava method seems not useful.

from tmdb-java.

urizev avatar urizev commented on May 27, 2024

@UweTrottmann Yes, you're right. I didn't realize. 😞

from tmdb-java.

NathHorrigan avatar NathHorrigan commented on May 27, 2024

I'll create a fork and let you know how it goes :)

from tmdb-java.

sevar83 avatar sevar83 commented on May 27, 2024

I derived my local RxJava1 tmdb service and just using the entities. I guess we need 1 main (entities + Call) and 2 additional optional artifacts - RxJava and RxJava2. Don't know this packaging stuff well but you could check out how it is done in RxBinding for example.

from tmdb-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.