RxJava
RxJava copied to clipboard
3.x: Add onDropped callbacks to operators
Add onDropped
callback overloads to most operators that drop items that can't be recovered by other means.
- [x]
throttleLatest
PR #7457 - [ ]
throttleFirst
(PR TBD) - [ ]
throttleLast
/sample
(PR TBD) - [ ]
throttleWithTimeout
/debounce
(PR TBD) - [ ]
onBackpressureLatest
(PR TBD) - [ ]
onBackpressureBuffer
(PR TBD)- 📓 The current overloads with
Action
are somewhat unhelpful, however, we'll have to add overloads in a way that avoids lambda ambiguity.
- 📓 The current overloads with
Hi - do you need any help with some of these?
@Desislav-Petrov you can have a stab at them. I won't have the time for weeks although there is no rush either.
Thanks, starting this week and will follow your PR per method strategy - I've started with throttleFirst
hi @akarnokd - i'm looking at throttleLast. From what I see, we should change the public void onNext(T t) method in the *SampleTimed class. More precisely, when we do the lazySet() we should check if a value exists there - if so we need to call the onDropped with this value as this is what we're dropping. Does this make sense?
@Desislav-Petrov lazySets
have to be made getAndSet
: https://github.com/ReactiveX/RxJava/blob/3.x/src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableThrottleLatest.java#L130
Thx - leave this with me, will do a PR shortly.
taking a look at throttleWithTimeout / debounce next
Looking at onBackpressureLatest next