February 2020
Intermediate to advanced
412 pages
9h 36m
English
The onBackpressureDrop() operator simply discards emissions if the downstream is too busy to process them. This is helpful when emissions are considered redundant if the downstream is already busy (such as the same request being sent repeatedly and is currently being executed). You can optionally provide an onDrop lambda argument, specifying what to do with each dropped item, as shown in the following code (the dropped items are simply printed):
import io.reactivex.rxjava3.core.Flowable;import io.reactivex.rxjava3.schedulers.Schedulers;public class Ch8_16 { public static void main(String[] args) { Flowable.interval(1, TimeUnit.MILLISECONDS) .onBackpressureDrop(i -> System.out.println("Dropping " + i)) .observeOn(Schedulers. ...
Read now
Unlock full access