Created
October 16, 2017 01:15
-
-
Save luks91/bc8b4e98d37803ed25a593f308dccd62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun sampleCall(api: ServerApi) { | |
pagedDataOf { start -> api.getStrings(start, pageLimit = 20) } | |
.subscribeOn(Schedulers.io()) | |
.subscribe(object: Subscriber<List<String>> { | |
override fun onSubscribe(subscription: Subscription) { | |
subscription.request(2) | |
} | |
override fun onNext(nextPage: List<String>) = System.out.println(nextPage) | |
override fun onError(t: Throwable) {} | |
override fun onComplete() {} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment