June 2018
Intermediate to advanced
310 pages
6h 32m
English
Much like any Subject is an Observer and Observable at the same time, any FlowableProcessor is a Flowable that is both a Publisher and Subscriber.
To understand this statement, let's take the example of ReplaySubject and rewrite it using ReplayProcessor:
val list = (8..23).toList() // Some non trivial numbersval iterator = list.iterator()val o = Observable.intervalRange(0, list.size.toLong(), 0, 10, TimeUnit.MILLISECONDS).map { iterator.next()}.toFlowable(BackpressureStrategy.DROP).publish()
Any Observable can be converted to Flowable using the toFlowable() method. As with any Flowable, we need to specify which strategy to use. In our case, we use BackpressureStrategy.DROP.
As you can see, Flowable supports the publish() ...
Read now
Unlock full access