Skip to content

Instantly share code, notes, and snippets.

@hhariri
Created April 4, 2015 14:52
Show Gist options
  • Save hhariri/4d66e93053fd45e274f5 to your computer and use it in GitHub Desktop.
Save hhariri/4d66e93053fd45e274f5 to your computer and use it in GitHub Desktop.
// Without it
ObservableHttp.createRequest(HttpAsyncMethods.createGet(url), client)
.toObservable()
.flatMap({ response -> response.getContent().map {
byte ->
String(byte)
}
})
.toBlocking()
.forEach {
data -> println(data)
}
}
// With it
ObservableHttp.createRequest(HttpAsyncMethods.createGet(url), client)
.toObservable()
.flatMap({
it.getContent().map {
String(it)
}
})
.toBlocking()
.forEach {
println(it)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment