Created
July 8, 2019 03:22
-
-
Save nhphong/2fd3e644b97f0f2bb4e780c045398ae5 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
val source = PublishSubject.create<Int>() | |
source | |
.debounceIf({ it.isOdd }, 2, SECONDS, Schedulers.io()) | |
.subscribe { print(it) } | |
source.onNext(1) | |
source.onNext(2) | |
source.onNext(3) | |
source.onNext(4) | |
Thread.sleep(10000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment