Thomas
Thomas

Reputation: 1083

RxJava 2: Stats about messages dropped because of BackPressure?

I am using RxJava 2 Flowable with DROP BackPressure strategy. Is there any way to collect information / stats about how many messages are actually dropped because of the BackPressure?

Solution

Flowable#onBackpressureDrop(consumer -> {}); http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html#onBackpressureDrop(io.reactivex.functions.Consumer)

Upvotes: 2

Views: 211

Answers (1)

akarnokd
akarnokd

Reputation: 69997

There is an overload that takes an onDrop handler you can use for counting.

Generally, it is advised to check an operator's overloads for additional features.

Upvotes: 2

Related Questions