Record Class StandardConcurrentConfig
java.lang.Object
java.lang.Record
io.reactivex.rxjava4.core.config.StandardConcurrentConfig
- Record Components:
errorMode- how to handle when errors appear from the inner or outer sourcesmaxConcurrency- the maximum number of concurrent flows?
public record StandardConcurrentConfig(@NonNull ErrorMode errorMode, int maxConcurrency)
extends Record
Standard configuration block with option to delay errors and change max concurrency
amounts.
The configuration record combines the conventional binary error handling mode and the trinary
error handling modes. Use the StandardConcurrentConfig(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 StandardConcurrentConfigThe default configuration with no error delay and Flowable#bufferSize() as the maximum concurrency and buffer size setting.static final StandardConcurrentConfigThe default configuration with error delay and Flowable#bufferSize() as the maximum concurrency and buffer size setting.static final StandardConcurrentConfigThe default configuration with error delay at the boundary and Flowable#bufferSize() as the maximum concurrency and buffer size setting.static final StandardConcurrentConfigThe default configuration with no error delay, MAX_VALUE for concurrency and Flowable#bufferSize() as the maximum concurrency setting.static final StandardConcurrentConfigThe default configuration with error delay, MAX_VALUE for concurrency and Flowable#bufferSize() as the maximum concurrency setting.static final StandardConcurrentConfigThe default configuration with error delay at the boundary, MAX_VALUE for concurrency and Flowable#bufferSize() as the maximum concurrency setting. -
Constructor Summary
ConstructorsConstructorDescriptionStandardConcurrentConfig(boolean delayErrors) Optionally delay error,Flowable.bufferSize()sizesStandardConcurrentConfig(boolean delayErrors, int maxConcurrency) Optionally delays errors and sets the buffer size too.StandardConcurrentConfig(int maxConcurrency) Optionally set the buffer size, no delay errors.StandardConcurrentConfig(@NonNull ErrorMode errorMode, int maxConcurrency) Fully customize the configuration.StandardConcurrentConfig(ErrorMode errorMode) Optionally delay error,Flowable.bufferSize()sizes -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns 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.Converts this config into the buffered version with the default buffer size offered by it.toBuffered(int bufferSize) Converts this config into the buffered version with the given buffer size offered by it.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
-
StandardConcurrentConfig
public StandardConcurrentConfig(boolean delayErrors) Optionally delay error,Flowable.bufferSize()sizes- Parameters:
delayErrors- should the error be delayed?
-
StandardConcurrentConfig
Optionally delay error,Flowable.bufferSize()sizes- Parameters:
errorMode- how to handle when errors appear from the inner or outer sources
-
StandardConcurrentConfig
public StandardConcurrentConfig(int maxConcurrency) Optionally set the buffer size, no delay errors.- Parameters:
maxConcurrency- the maximum number of concurrent flows
-
StandardConcurrentConfig
public StandardConcurrentConfig(boolean delayErrors, int maxConcurrency) Optionally delays errors and sets the buffer size too.- Parameters:
delayErrors- should the errors be delayed?maxConcurrency- the maximum number of concurrent flows
-
StandardConcurrentConfig
-
-
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,
-
toBuffered
Converts this config into the buffered version with the default buffer size offered by it.- Returns:
- the new
StandardConcurrentBufferConfiginstance
-
toBuffered
Converts this config into the buffered version with the given buffer size offered by it.- Parameters:
bufferSize- the expected number of items to buffer or prefetch from the various sources- Returns:
- the new
StandardConcurrentBufferConfiginstance
-
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
-