June 2017
Intermediate to advanced
400 pages
8h 44m
English
The onBackpressureDrop()will simply discard emissions if the downstream is too busy to process them. This is helpful when emissions are considered redundant if the downstream is already occupied (such as a "RUN" request being sent repeatedly, although the resulting process is already running). You can optionally provide an onDrop lambda argument specifying what to do with each dropped item, which we will simply print, as shown in the following code:
import io.reactivex.Flowable; import io.reactivex.schedulers.Schedulers; import java.util.concurrent.TimeUnit;public class Launcher { public static void main(String[] args) { Flowable.interval(1, TimeUnit.MILLISECONDS) .onBackpressureDrop(i -> System.out.println("Dropping ...Read now
Unlock full access