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

    • DEFAULT

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

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

      public StandardConcurrentConfig(ErrorMode errorMode)
      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

      public StandardConcurrentConfig(@NonNull @NonNull ErrorMode errorMode, int maxConcurrency)
      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?
  • 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

      public StandardConcurrentBufferedConfig toBuffered()
      Converts this config into the buffered version with the default buffer size offered by it.
      Returns:
      the new StandardConcurrentBufferConfig instance
    • toBuffered

      public StandardConcurrentBufferedConfig toBuffered(int bufferSize)
      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 StandardConcurrentBufferConfig instance
    • 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