Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

RxJava2 Adapter

An adapter for adapting RxJava 2.x types.

Available types:

  • Flowable<T> with T being AtomFeed or RssFeed.
  • Maybe<T> with T being AtomFeed or RssFeed.
  • Single<T> with T being AtomFeed or RssFeed.


Pass RxJava2CallAdapterFactory as parameter to Syndication.

val syndicationReader = Syndication(
  url = "",
  callFactory = RxJava2CallAdapterFactory.create()

create and interface like the one below

interface RssReader {

  fun readFlowable(): Flowable<RssFeed>

  fun readMaybe(): Maybe<RssFeed>
  fun readSingle(): Single<RssFeed>

then let Syndication class generates an implementation of that interface RssReader:

val reader = syndicationReader.create(
reader.readFlowable().subscribe { rssFeed -> /* do something */ }
reader.readMaybe().subscribe { rssFeed -> /* do something */ }
reader.readSingle().subscribe { rssFeed -> /* do something */ }

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

implementation 'com.ouattararomuald:syndication-rxjava2-adapter:0.1.0-rc.1'

or Maven:


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