Record Class ParallelSchedulerConfig

java.lang.Object
java.lang.Record
io.reactivex.rxjava4.core.config.ParallelSchedulerConfig
Record Components:
parallelism - the number of concurrent threads, default the number of CPUs.
tracking - if true, tasks submitted to it will be tracked and can be en-masse disposed
priority - the thread priority of the created platform threads. See Thread.NORM_PRIORITY.
threadNamePrefix - the prefix to name the scheduler's threads
factory - the customizable factory for the underlying Executor, if non-null, the priority and threadNamePrefix are ignored

public record ParallelSchedulerConfig(int parallelism, boolean tracking, int priority, @NonNull String threadNamePrefix, @Nullable ThreadFactory factory) extends Record
  • Field Details

    • DEFAULT

      public static final ParallelSchedulerConfig DEFAULT
      Default configuration: Available CPU parallelism, tracking on, normal thread priority RxParallelScheduler naming and no custom ThreadFactory.
  • Constructor Details

    • ParallelSchedulerConfig

      public ParallelSchedulerConfig(int parallelism)
      Creates a default config with the given parallelism, normal priority, tracking and RxParallelScheduler thread name prefix.
      Parameters:
      parallelism - the number of threads to work with in the scheduler
    • ParallelSchedulerConfig

      public ParallelSchedulerConfig(int parallelism, boolean tracking)
      Creates a default config with the given parallelism, normal priority, optionally tracking and RxParallelScheduler thread name prefix.
      Parameters:
      parallelism - the number of threads to work with in the scheduler
      tracking - if true, tasks submitted to it will be tracked and can be en-masse disposed
    • ParallelSchedulerConfig

      public ParallelSchedulerConfig(int parallelism, @NonNull @NonNull String threadNamePrefix)
      Creates a default config with the given parallelism, normal priority, optionally tracking and RxParallelScheduler thread name prefix.
      Parameters:
      parallelism - the number of threads to work with in the scheduler
      threadNamePrefix - the prefix to name the scheduler's threads
    • ParallelSchedulerConfig

      public ParallelSchedulerConfig(int parallelism, boolean tracking, @NonNull @NonNull String threadNamePrefix)
      Creates a default config with the given parallelism, normal priority, optionally tracking and RxParallelScheduler thread name prefix.
      Parameters:
      parallelism - the number of threads to work with in the scheduler
      tracking - if true, tasks submitted to it will be tracked and can be en-masse disposed
      threadNamePrefix - the prefix to name the scheduler's threads
    • ParallelSchedulerConfig

      public ParallelSchedulerConfig(int parallelism, boolean tracking, @NonNull @NonNull ThreadFactory factory)
      Creates a default config with the given parallelism, normal priority, optionally tracking and RxParallelScheduler thread name prefix.
      Parameters:
      parallelism - the number of threads to work with in the scheduler
      tracking - if true, tasks submitted to it will be tracked and can be en-masse disposed
      factory - the customizable factory for the underlying Executor
    • ParallelSchedulerConfig

      public ParallelSchedulerConfig(int parallelism, boolean tracking, int priority, @NonNull @NonNull String threadNamePrefix, @Nullable @Nullable ThreadFactory factory)
      Creates a fully configurable ParallelSchedulerConfig object.
      Parameters:
      parallelism - the number of threads to work with in the scheduler
      tracking - if true, tasks submitted to it will be tracked and can be en-masse disposed
      priority - the thread priority of the created platform threads. See Thread.NORM_PRIORITY.
      threadNamePrefix - the prefix to name the scheduler's threads
      factory - the customizable factory for the underlying Executor, if non-null, the priority and threadNamePrefix are ignored
  • 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.
    • parallelism

      public int parallelism()
      Returns the value of the parallelism record component.
      Returns:
      the value of the parallelism record component
    • tracking

      public boolean tracking()
      Returns the value of the tracking record component.
      Returns:
      the value of the tracking record component
    • priority

      public int priority()
      Returns the value of the priority record component.
      Returns:
      the value of the priority record component
    • threadNamePrefix

      @NonNull public @NonNull String threadNamePrefix()
      Returns the value of the threadNamePrefix record component.
      Returns:
      the value of the threadNamePrefix record component
    • factory

      @Nullable public @Nullable ThreadFactory factory()
      Returns the value of the factory record component.
      Returns:
      the value of the factory record component