Consider the following use case:
- need to deliver first item as soon as possible
- need to debounce following events with 1 second timeout
I ended up implementing custom operator based on OperatorDebounceWithTime
then using it like this
.lift(new CustomOperatorDebounceWithTime<>(1, TimeUnit.SECONDS, Schedulers.computation()))
CustomOperatorDebounceWithTime
delivers the first item immediately then uses OperatorDebounceWithTime
operator's logic to debounce later items.
Is there an easier way to achieve described behavior? Let's skip the compose
operator, it doesn't solve the problem. I'm looking for a way to achieve this without implementing custom operators.