I'm trying to write a test to see the use of onBackPressureDrop in RxScala.
I'm zipping a fast Obserable with a slow one, with a simple zipping function.
The curious thing is that the same example in RxJava produces the exception but with RxScala it seems to not need the onBackPressureDrop instruction.
The test looks like the following:
@Test def testWithoutBackPressure() {
val fast = Observable.interval(1 millis).take(100)
val slow = Observable.interval(1000 millis).take(100)
val res = fast.zipWith(slow)(_*_)
res.subscribe(
n => { println("[testWithoutBackPressure] " + n) },
e => e.printStackTrace(),
() => println("testWithoutBackPressure done")
)
}
How can I make this code fail because of the absence of backpressure?