-
- All Implemented Interfaces:
-
java.io.Serializable
public class MissingBackpressureException extends Exception
Represents an exception that indicates that a Subscriber or operator attempted to apply reactive pull backpressure to an Observable that does not implement it.
If an Observable has not been written to support reactive pull backpressure (such support is not a requirement for Observables), you can apply one of the following operators to it, each of which forces a simple form of backpressure behavior:
If you do not apply either of these operators to an Observable that does not support backpressure, and if either you as the Subscriber or some operator between you and the Observable attempts to apply reactive pull backpressure, you will encounter a{@code MissingBackpressureException}
which you will be notified of via your{@code onError}
callback.There are, however, other options. You can throttle an over-producing Observable with operators like
{@code sample}
/{@code throttleLast}
,{@code throttleFirst}
, or{@code throttleWithTimeout}
/{@code debounce}
. You can also take the large number of items emitted by an over-producing Observable and package them into a smaller set of emissions by using operators like{@code buffer}
and{@code window}
.For a more complete discussion of the options available to you for dealing with issues related to backpressure and flow control in RxJava, see RxJava wiki: Backpressure.
-
-
Constructor Summary
Constructors Constructor Description MissingBackpressureException()
Constructs the exception without any custom message. MissingBackpressureException(String message)
Constructs the exception with the given customized message.
-
Method Summary
Modifier and Type Method Description -
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
MissingBackpressureException
MissingBackpressureException()
Constructs the exception without any custom message.
-
MissingBackpressureException
MissingBackpressureException(String message)
Constructs the exception with the given customized message.- Parameters:
message
- the customized message
-
-
-
-