Type Name Latest commit message Commit time
Failed to load latest commit information.
src Replace @ParametersAreNonnullByDefault with @EverythingIsNonNull Oct 6, 2018 Update Jul 4, 2018
pom.xml [maven-release-plugin] prepare for next development iteration Nov 18, 2018

RxJava2 Adapter

An Adapter for adapting RxJava 2.x types.

Available types:

  • Observable<T>, Observable<Response<T>>, and Observable<Result<T>> where T is the body type.
  • Flowable<T>, Flowable<Response<T>> and Flowable<Result<T>> where T is the body type.
  • Single<T>, Single<Response<T>>, and Single<Result<T>> where T is the body type.
  • Maybe<T>, Maybe<Response<T>>, and Maybe<Result<T>> where T is the body type.
  • Completable where response bodies are discarded.


Add RxJava2CallAdapterFactory as a Call adapter when building your Retrofit instance:

Retrofit retrofit = new Retrofit.Builder()

Your service methods can now use any of the above types as their return type.

interface MyService {
  Observable<User> getUser();

By default all reactive types execute their requests synchronously. There are multiple ways to control the threading on which a request occurs:

  • Call subscribeOn on the returned reactive type with a Scheduler of your choice.
  • Use createAsync() when creating the factory which will use OkHttp's internal thread pool.
  • Use createWithScheduler(Scheduler) to supply a default subscription Scheduler.


Download the latest JAR or grab via Maven:


or Gradle:

implementation 'com.squareup.retrofit2:adapter-rxjava2:latest.version'

Snapshots of the development version are available in Sonatype's snapshots repository.