Skip to content

Instantly share code, notes, and snippets.

@AndSky90
Created November 4, 2019 14:07
Show Gist options
  • Save AndSky90/578a222be0864a06aaab91343e6be646 to your computer and use it in GitHub Desktop.
Save AndSky90/578a222be0864a06aaab91343e6be646 to your computer and use it in GitHub Desktop.
observable from callable rx
fun loadPdf(url: String) = Observable.fromCallable {
val request = Request.Builder().url(url).build()
val call = coreNetwork.getOkHttp().newCall(request)
call.execute().body()!!.source().inputStream()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment