Created
July 10, 2019 10:37
-
-
Save erlangparasu/71e7cb2e8c5ede88ee375455aef64223 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Observable.interval(1, TimeUnit.MICROSECONDS) | |
| .toFlowable(BackpressureStrategy.DROP) | |
| .observeOn(Schedulers.io(), false, 1) | |
| .doOnNext { t -> | |
| println(t) | |
| try { | |
| Thread.sleep(1000) | |
| } catch (e: Exception) { | |
| // | |
| } | |
| } | |
| .subscribe(Consumer { myLong -> | |
| // equals to onNext | |
| }, Consumer { myThrowable -> | |
| // equals to onError | |
| }, Action { | |
| // equals to onComplete | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment