Sample operator: last item before termination is dropped after sampling
See original GitHub issueHi. Recently I found that sample
operator drops last value before onCompleted
event. This is behaviour is valid according to these discussions https://github.com/ReactiveX/RxJava/pull/566 and https://github.com/ReactiveX/RxJava/pull/571 and this test. It originated in Rx.NET and still exists in RxJava to be consistent across all implementations as far as I understood.
But, marble diagram in documentation shows otherwise: item 5 is emitted before termination and sampled by sampler.
This behaviour is odd and unexpectable. I stumbled across it trying to resolve backpressure issue with observables where last emitted item is the most important.
So, my question is whether it can be changed? I prepared a commit with fixes and corresponding tests. Or at least marble diagram should be changed to showcase this behaviour and it would be good to have a note about it in documentation.
Thank you.
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (6 by maintainers)
Done https://github.com/ReactiveX/RxJava/pull/3757
#3757 merged.