Record Class OnBackpressureBufferConfig<T>

java.lang.Object
java.lang.Record
io.reactivex.rxjava4.core.config.OnBackpressureBufferConfig<T>
Type Parameters:
T - the element type of the sequences being compared
Record Components:
capacity - number of slots available in the buffer.
delayError - if true, an exception from the current Flowable is delayed until all buffered elements have been consumed by the downstream; if false, an exception is immediately signaled to the downstream, skipping any buffered element
unbounded - if true, the capacity value is interpreted as the internal "island" size of the unbounded buffer
onDropped - the Consumer to be called with the item that could not be buffered due to capacity constraints.

public record OnBackpressureBufferConfig<T>(int capacity, boolean delayError, boolean unbounded, @NonNull Consumer<? super T> onDropped) extends Record
Configuration record for onBackpressureBuffer() operators.
Since:
4.0.0
  • Field Details

    • DEFAULT

      public static final OnBackpressureBufferConfig<Object> DEFAULT
      The default settings with no error delay, unbounded, no onOverflow or onDropped activity.
  • Constructor Details

    • OnBackpressureBufferConfig

      public OnBackpressureBufferConfig(int capacity)
      Creates a config with the given capacity, no error delay, bounded, no callbacks.
      Parameters:
      capacity - number of slots available in the buffer.
    • OnBackpressureBufferConfig

      public OnBackpressureBufferConfig(boolean delayError)
      Creates a config with the given error delay mode, capacity of Flowable.bufferSize(), bounded, and no callback.
      Parameters:
      delayError - if true, an exception from the current Flowable is delayed until all buffered elements have been consumed by the downstream; if false, an exception is immediately signaled to the downstream, skipping any buffered element
    • OnBackpressureBufferConfig

      public OnBackpressureBufferConfig(int capacity, boolean delayError)
      Creates a config with the given capacity, given error delay mode, bounded, and no callback.
      Parameters:
      capacity - number of slots available in the buffer.
      delayError - if true, an exception from the current Flowable is delayed until all buffered elements have been consumed by the downstream; if false, an exception is immediately signaled to the downstream, skipping any buffered element
    • OnBackpressureBufferConfig

      public OnBackpressureBufferConfig(boolean delayError, boolean unbounded)
      Creates a config with the given error delay mode, given boundedneess, capacity of Flowable.bufferSize() and no callback.
      Parameters:
      delayError - if true, an exception from the current Flowable is delayed until all buffered elements have been consumed by the downstream; if false, an exception is immediately signaled to the downstream, skipping any buffered element
      unbounded - if true, the capacity value is interpreted as the internal "island" size of the unbounded buffer
    • OnBackpressureBufferConfig

      public OnBackpressureBufferConfig(int capacity, boolean delayError, boolean unbounded)
      Creates a config with the given capacity, error delay mode and unboundedness, and no callback.
      Parameters:
      capacity - number of slots available in the buffer.
      delayError - if true, an exception from the current Flowable is delayed until all buffered elements have been consumed by the downstream; if false, an exception is immediately signaled to the downstream, skipping any buffered element
      unbounded - if true, the capacity value is interpreted as the internal "island" size of the unbounded buffer
    • OnBackpressureBufferConfig

      public OnBackpressureBufferConfig(@NonNull @NonNull Consumer<? super T> onDropped)
      Creates a config with the given onDropped callback, capacity of Flowable.bufferSize(), no error delay, bounded, and no callback.
      Parameters:
      onDropped - the Consumer to be called with the item that could not be buffered due to capacity constraints.
    • OnBackpressureBufferConfig

      public OnBackpressureBufferConfig(int capacity, @NonNull @NonNull Consumer<? super T> onDropped)
      Creates a config with the given capacity, given onDropped callback no error delay, bounded, and no callback.
      Parameters:
      capacity - number of slots available in the buffer.
      onDropped - the Consumer to be called with the item that could not be buffered due to capacity constraints.
    • OnBackpressureBufferConfig

      public OnBackpressureBufferConfig(int capacity, boolean delayError, boolean unbounded, @NonNull @NonNull Consumer<? super T> onDropped)
      Creates a config with all the provided values.
      Parameters:
      capacity - number of slots available in the buffer.
      delayError - if true, an exception from the current Flowable is delayed until all buffered elements have been consumed by the downstream; if false, an exception is immediately signaled to the downstream, skipping any buffered element
      unbounded - if true, the capacity value is interpreted as the internal "island" size of the unbounded buffer
      onDropped - the Consumer to be called with the item that could not be buffered due to capacity constraints.
  • Method Details

    • 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.
    • capacity

      public int capacity()
      Returns the value of the capacity record component.
      Returns:
      the value of the capacity record component
    • delayError

      public boolean delayError()
      Returns the value of the delayError record component.
      Returns:
      the value of the delayError record component
    • unbounded

      public boolean unbounded()
      Returns the value of the unbounded record component.
      Returns:
      the value of the unbounded record component
    • onDropped

      @NonNull public @NonNull Consumer<? super T> onDropped()
      Returns the value of the onDropped record component.
      Returns:
      the value of the onDropped record component