December 2017
Intermediate to advanced
322 pages
7h 3m
English
This operator serves the purpose of BackpressureStrategy.BUFFER; except that here, you'll get some extra configuration options, such as buffer size, bounded or unbounded, and more. You may omit the configurations as well to use the default behavior.
So, let's look at some examples:
fun main(args: Array<String>) {
val source = Observable.range(1, 1000)
source.toFlowable(BackpressureStrategy.MISSING)//(1)
.onBackpressureBuffer()//(2)
.map { MyItem11(it) }
.observeOn(Schedulers.io())
.subscribe{
println(it)
runBlocking { delay(1000) }
}
runBlocking { delay(600000) }
}
data class MyItem11 (val id:Int) {
init {
println("MyItem Created $id")
}
}
Again, we are using the previous program with little tweaks. On comment ...
Read now
Unlock full access