I have rx.Observable which emits the progress of the task up to onNext() . onNext() can occur so quickly that the Observer cannot keep up, resulting in backpressure . I would like to handle back pressure only by buffering the last radiation from the Observable .
For instance:
Observable emits 1 and Observer gets 1 .- While the
Observer is still processing 1 , the Observable allocates 2 , 3, and 4 . Observer completes processing 1 and starts processing 4 (outliers 2 and 3 ).
It seems like this will be a common case for handling progress in the Rx Observable, since you usually care about updating your interface with the latest progress information. However, I could not figure out how to do this.
Does anyone know how this can be achieved with RxJava?
source share