Are there any difference between throttleLast(long, TimeUnit)
and sample(long, TimeUnit)
of Observable?
Both emit the last item of interval, so they are the same method to me.
If there are differences, what would be the better use case?
According to the rx-java 1.0.x source code, it is the same thing, as throttleLast() is just calling sample():
https://github.com/ReactiveX/RxJava/blob/v1.0.16/src/main/java/rx/Observable.java#L8819-L8821
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With