Package io.reactivex.rxjava3.core
Enum Class BackpressureStrategy
- All Implemented Interfaces:
Serializable
,Comparable<BackpressureStrategy>
,Constable
Represents the options for applying backpressure to a source sequence.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBuffers allonNext
values until the downstream consumes it.Drops the most recentonNext
value if the downstream can't keep up.Signals aMissingBackpressureException
in case the downstream can't keep up.Keeps only the latestonNext
value, overwriting any previous value if the downstream can't keep up.TheonNext
events are written without any buffering or dropping. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BackpressureStrategy
Returns the enum constant of this class with the specified name.static BackpressureStrategy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MISSING
TheonNext
events are written without any buffering or dropping. Downstream has to deal with any overflow.Useful when one applies one of the custom-parameter onBackpressureXXX operators.
-
ERROR
Signals aMissingBackpressureException
in case the downstream can't keep up. -
BUFFER
Buffers allonNext
values until the downstream consumes it. -
DROP
Drops the most recentonNext
value if the downstream can't keep up. -
LATEST
Keeps only the latestonNext
value, overwriting any previous value if the downstream can't keep up.
-
-
Constructor Details
-
BackpressureStrategy
private BackpressureStrategy()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-