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 sources
maxConcurrency - 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 Details

    • DEFAULT

      public static final StandardConcurrentBufferedConfig DEFAULT
      The default configuration with no error delay and Flowable#bufferSize() as the maximum concurrency and buffer size setting.
    • DELAY_ERRORS

      public static final StandardConcurrentBufferedConfig DELAY_ERRORS
      The default configuration with error delay and Flowable#bufferSize() as the maximum concurrency and buffer size setting.
    • DELAY_ERRORS_BOUNDARY

      public static final StandardConcurrentBufferedConfig 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

      public static final StandardConcurrentBufferedConfig MAX_DEFAULT
      The default configuration with no error delay, MAX_VALUE for concurrency and Flowable#bufferSize() as the maximum concurrency setting.
    • MAX_DELAY_ERRORS

      public static final StandardConcurrentBufferedConfig 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

      public static final StandardConcurrentBufferedConfig 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 to Flowable.bufferSize().
      Parameters:
      delayErrors - should the error be delayed?
    • StandardConcurrentBufferedConfig

      public StandardConcurrentBufferedConfig(ErrorMode errorMode)
      Sets the error mode to provided value, the maxConcurrency and bufferSize to Flowable.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 to Flowable.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 to Flowable.bufferSize().
      Parameters:
      delayErrors - should the errors be delayed?
      maxConcurrency - the maximum number of concurrent flows
    • StandardConcurrentBufferedConfig

      public StandardConcurrentBufferedConfig(ErrorMode errorMode, int maxConcurrency)
      Sets the error mode to provided value, the maxConcurrency to the provided value and bufferSize to Flowable.bufferSize().
      Parameters:
      errorMode - how to handle when errors appear from the inner or outer sources
      maxConcurrency - 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 flows
      bufferSize - 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 sources
      maxConcurrency - 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

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • errorMode

      @NonNull public @NonNull ErrorMode errorMode()
      Returns the value of the errorMode record component.
      Returns:
      the value of the errorMode record component
    • maxConcurrency

      public int maxConcurrency()
      Returns the value of the maxConcurrency record component.
      Returns:
      the value of the maxConcurrency record component
    • bufferSize

      public int bufferSize()
      Returns the value of the bufferSize record component.
      Returns:
      the value of the bufferSize record component