These are chat archives for ReactiveX/RxJava

14th
Sep 2016
Samuel Tardieu
@samueltardieu
Sep 14 2016 15:21
If I call onNext(subscriber) (from inside Observable.create(…)) when I get called back by a hot source of data I don't control, is there a way to ensure that onNext succeeds immediately and does not block until the subscriber has finished handling it?
Samuel Tardieu
@samueltardieu
Sep 14 2016 15:30
In fact, I want something like: hot observable made from callback onNext calls that should not block -> onBackpressureLatest -> one-at-a-time lengthy processing
The idea is that as soon as I can process a new data from the callback I want to process the latest one so far if it has not been processed yet.
Dorus
@Dorus
Sep 14 2016 15:42
@samueltardieu You should be able to do source.subsctibeOn(scheduler).subscribe()
but that will line up all values. If you want to drop values you could use sample with a timeout of zero, or use one of the back pressure operators, probably the one with drop.
Samuel Tardieu
@samueltardieu
Sep 14 2016 15:55
@Dorus As I wrote, I use onBackPressureLatest
Anyway, I don't like the backed-after-the-fact backpressure in RxJava1, so I'll switch to RxJava 2 for this part (which is quite independent), that will be a reason to migrate the rest of the application later :-)
We'll see if the split of concerns between Observable and Flowable makes things easier :-)
(as soon as I find how to manage those two rxjava.properties that are now included in my apk)