Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src
.gitignore
README.md
build.gradle
gradle.properties

README.md

Kotlin Coroutines Adapter

A [CallAdapter.Factory] for use with kotlin coroutine's Deferred.

Usage

Pass CoroutineCallAdapterFactory as parameter to Syndication.

val syndicationReader = Syndication(
  url = "https://www.lequipe.fr/rss/actu_rss.xml",
  callFactory = CoroutineCallAdapterFactory()
)

create and interface like the one below

interface RssReader {

  fun readRss(): Deferred<RssFeed>

  fun readAtom(): Deferred<AtomFeed>
}

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

val reader = syndicationReader.create(RssReader::class.java)
val rssFeed = runBlocking { reader.readRss() }
val atomFeed = runBlocking { reader.readAtom() }

Download

Download the latest JAR or grab via Gradle:

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

or Maven:

<dependency>
  <groupId>com.ouattararomuald</groupId>
  <artifactId>syndication-kotlin-coroutines-adapter</artifactId>
  <version>0.1.0-rc.1</version>
</dependency>

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