Record Class StandardConcurrentBufferedConfig
java.lang.Object
java.lang.Record
io.reactivex.rxjava4.core.config.StandardConcurrentBufferedConfig
- Record Components:
errorMode- how to handle when errors appear from the inner or outer sourcesmaxConcurrency- the maximum number of concurrent flows?bufferSize- the expected number of items to buffer or prefetch from the various sources
public record StandardConcurrentBufferedConfig(@NonNull ErrorMode errorMode, int maxConcurrency, int bufferSize)
extends Record
Standard configuration block with option to delay errors, change max concurrency
amounts and buffer/prefetch sizes.
The configuration record combines the conventional binary error handling mode and the trinary
error handling modes. Use the StandardConcurrentBufferedConfig(boolean) constructors to create
those binary cases with this record.
TODO once value classes are available, make this a record class.
- Since:
- 4.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StandardConcurrentBufferedConfigThe default configuration with no error delay and Flowable#bufferSize() as the maximum concurrency and buffer size setting.static final StandardConcurrentBufferedConfigThe default configuration with error delay and Flowable#bufferSize() as the maximum concurrency and buffer size setting.static final StandardConcurrentBufferedConfigThe default configuration with error delay at the boundary and Flowable#bufferSize() as the maximum concurrency and buffer size setting.static final StandardConcurrentBufferedConfigThe default configuration with no error delay, MAX_VALUE for concurrency and Flowable#bufferSize() as the maximum concurrency setting.static final StandardConcurrentBufferedConfigThe default configuration with error delay, MAX_VALUE for concurrency and Flowable#bufferSize() as the maximum concurrency setting.static final StandardConcurrentBufferedConfigThe default configuration with error delay at the boundary, MAX_VALUE for concurrency and Flowable#bufferSize() as the maximum concurrency setting. -
Constructor Summary
ConstructorsConstructorDescriptionStandardConcurrentBufferedConfig(boolean delayErrors) Sets the error mode to provided IMMEDIATE (false) or END (true), the maxConcurrency and bufferSize toFlowable.bufferSize().StandardConcurrentBufferedConfig(boolean delayErrors, int maxConcurrency) Sets the error mode to provided IMMEDIATE (false) or END (true), the maxConcurrency to the provided value and bufferSize toFlowable.bufferSize().StandardConcurrentBufferedConfig(boolean delayErrors, int maxConcurrency, int bufferSize) Sets the error mode to provided IMMEDIATE (false) or END (true), the maxConcurrency to the provided value and bufferSize to the provided value too.StandardConcurrentBufferedConfig(int maxConcurrency) Sets the error mode to IMMEDIATE, the maxConcurrency to the provided value and bufferSize toFlowable.bufferSize().StandardConcurrentBufferedConfig(@NonNull ErrorMode errorMode, int maxConcurrency, int bufferSize) Fully customize the configuration.StandardConcurrentBufferedConfig(ErrorMode errorMode) Sets the error mode to provided value, the maxConcurrency and bufferSize toFlowable.bufferSize().StandardConcurrentBufferedConfig(ErrorMode errorMode, int maxConcurrency) Sets the error mode to provided value, the maxConcurrency to the provided value and bufferSize toFlowable.bufferSize(). -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebufferSizerecord component.booleanReturns true if this config is set to a delayed error handling mode, such as BOUNDARY or ENDfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorModerecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxConcurrencyrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
The default configuration with no error delay and Flowable#bufferSize() as the maximum concurrency and buffer size setting. -
DELAY_ERRORS
The default configuration with error delay and Flowable#bufferSize() as the maximum concurrency and buffer size setting. -
DELAY_ERRORS_BOUNDARY
The default configuration with error delay at the boundary and Flowable#bufferSize() as the maximum concurrency and buffer size setting. -
MAX_DEFAULT
The default configuration with no error delay, MAX_VALUE for concurrency and Flowable#bufferSize() as the maximum concurrency setting. -
MAX_DELAY_ERRORS
The default configuration with error delay, MAX_VALUE for concurrency and Flowable#bufferSize() as the maximum concurrency setting. -
MAX_DELAY_ERRORS_BOUNDARY
The default configuration with error delay at the boundary, MAX_VALUE for concurrency and Flowable#bufferSize() as the maximum concurrency setting.
-
-
Constructor Details
-
StandardConcurrentBufferedConfig
public StandardConcurrentBufferedConfig(boolean delayErrors) Sets the error mode to provided IMMEDIATE (false) or END (true), the maxConcurrency and bufferSize toFlowable.bufferSize().- Parameters:
delayErrors- should the error be delayed?
-
StandardConcurrentBufferedConfig
Sets the error mode to provided value, the maxConcurrency and bufferSize toFlowable.bufferSize().- Parameters:
errorMode- how to handle when errors appear from the inner or outer sources
-
StandardConcurrentBufferedConfig
public StandardConcurrentBufferedConfig(int maxConcurrency) Sets the error mode to IMMEDIATE, the maxConcurrency to the provided value and bufferSize toFlowable.bufferSize().- Parameters:
maxConcurrency- the maximum number of concurrent flows
-
StandardConcurrentBufferedConfig
public StandardConcurrentBufferedConfig(boolean delayErrors, int maxConcurrency) Sets the error mode to provided IMMEDIATE (false) or END (true), the maxConcurrency to the provided value and bufferSize toFlowable.bufferSize().- Parameters:
delayErrors- should the errors be delayed?maxConcurrency- the maximum number of concurrent flows
-
StandardConcurrentBufferedConfig
Sets the error mode to provided value, the maxConcurrency to the provided value and bufferSize toFlowable.bufferSize().- Parameters:
errorMode- how to handle when errors appear from the inner or outer sourcesmaxConcurrency- the maximum number of concurrent flows
-
StandardConcurrentBufferedConfig
public StandardConcurrentBufferedConfig(boolean delayErrors, int maxConcurrency, int bufferSize) Sets the error mode to provided IMMEDIATE (false) or END (true), the maxConcurrency to the provided value and bufferSize to the provided value too.- Parameters:
delayErrors- should the error be delayed?maxConcurrency- the maximum number of concurrent flowsbufferSize- the expected number of items to buffer or prefetch from the various sources
-
StandardConcurrentBufferedConfig
public StandardConcurrentBufferedConfig(@NonNull @NonNull ErrorMode errorMode, int maxConcurrency, int bufferSize) Fully customize the configuration.- Parameters:
errorMode- how to handle when errors appear from the inner or outer sourcesmaxConcurrency- the maximum number of concurrent flows?bufferSize- the expected number of items to buffer or prefetch from the various sources
-
-
Method Details
-
delayErrors
public boolean delayErrors()Returns true if this config is set to a delayed error handling mode, such as BOUNDARY or END- Returns:
- true if this config is set to a delayed error handling mode,
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
errorMode
-
maxConcurrency
public int maxConcurrency()Returns the value of themaxConcurrencyrecord component.- Returns:
- the value of the
maxConcurrencyrecord component
-
bufferSize
public int bufferSize()Returns the value of thebufferSizerecord component.- Returns:
- the value of the
bufferSizerecord component
-