Last active
May 16, 2017 20:16
-
-
Save julianfalcionelli/10f390ef4953212442320819795bf3dc to your computer and use it in GitHub Desktop.
Single Example
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
//--- | |
Single.create((SingleOnSubscribe<String>) e -> e.onSuccess(makeBlockingTask())) | |
.subscribeOn(Schedulers.io()) //Run on IO Thread | |
.observeOn(AndroidSchedulers.mainThread()) //Run on UI Thread | |
.doOnSubscribe(__ -> showLoadingIndicator()) | |
.doFinally(() -> hideLoadingIndicator()) | |
.subscribe(this::processResult, | |
this::processError); | |
//--- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment