December 2017
Intermediate to advanced
322 pages
7h 3m
English
Processors are the counterparts for Subjects in Flowable. Every type of Subject has its counterpart as processor with backpressure support.
In the previous chapter (Chapter 3, Observables, Observers, and Subjects), we started exploring Subject, with the PublishSubject; so, let's do the same here. Let's get started with PublishProcessor.
The following is an example of PublishProcessor:
fun main(args: Array<String>) {
val flowable = listOf("String 1","String 2","String 3", "String 4","String 5").toFlowable()//(1) val processor = PublishProcessor.create<String>()//(2) processor.//(3) subscribe({ println("Subscription 1: $it") runBlocking { delay(1000) } println("Subscription 1 delay") }) processor//(4) .subscribe({ println("Subscription ...Read now
Unlock full access