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 disposedpriority- the thread priority of the created platform threads. SeeThread.NORM_PRIORITY.threadNamePrefix- the prefix to name the scheduler's threadsfactory- 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
Configuration record for
Schedulers.createParallel(ParallelSchedulerConfig).-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParallelSchedulerConfigDefault configuration: Available CPU parallelism, tracking on, normal thread priorityRxParallelSchedulernaming and no customThreadFactory. -
Constructor Summary
ConstructorsConstructorDescriptionParallelSchedulerConfig(int parallelism) Creates a default config with the given parallelism, normal priority, tracking and RxParallelScheduler thread name prefix.ParallelSchedulerConfig(int parallelism, boolean tracking) Creates a default config with the given parallelism, normal priority, optionally tracking and RxParallelScheduler thread name prefix.ParallelSchedulerConfig(int parallelism, boolean tracking, int priority, @NonNull String threadNamePrefix, @Nullable ThreadFactory factory) Creates a fully configurable ParallelSchedulerConfig object.ParallelSchedulerConfig(int parallelism, boolean tracking, @NonNull String threadNamePrefix) Creates a default config with the given parallelism, normal priority, optionally tracking and RxParallelScheduler thread name prefix.ParallelSchedulerConfig(int parallelism, boolean tracking, @NonNull ThreadFactory factory) Creates a default config with the given parallelism, normal priority, optionally tracking and RxParallelScheduler thread name prefix.ParallelSchedulerConfig(int parallelism, @NonNull String threadNamePrefix) Creates a default config with the given parallelism, normal priority, optionally tracking and RxParallelScheduler thread name prefix. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.factory()Returns the value of thefactoryrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of theparallelismrecord component.intpriority()Returns the value of thepriorityrecord component.Returns the value of thethreadNamePrefixrecord component.final StringtoString()Returns a string representation of this record class.booleantracking()Returns the value of thetrackingrecord component.
-
Field Details
-
DEFAULT
Default configuration: Available CPU parallelism, tracking on, normal thread priorityRxParallelSchedulernaming and no customThreadFactory.
-
-
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 schedulertracking- if true, tasks submitted to it will be tracked and can be en-masse disposed
-
ParallelSchedulerConfig
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 schedulerthreadNamePrefix- 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 schedulertracking- if true, tasks submitted to it will be tracked and can be en-masse disposedthreadNamePrefix- 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 schedulertracking- if true, tasks submitted to it will be tracked and can be en-masse disposedfactory- 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 schedulertracking- if true, tasks submitted to it will be tracked and can be en-masse disposedpriority- the thread priority of the created platform threads. SeeThread.NORM_PRIORITY.threadNamePrefix- the prefix to name the scheduler's threadsfactory- the customizable factory for the underlying Executor, if non-null, the priority and threadNamePrefix are ignored
-
-
Method Details
-
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. -
parallelism
public int parallelism()Returns the value of theparallelismrecord component.- Returns:
- the value of the
parallelismrecord component
-
tracking
-
priority
-
threadNamePrefix
Returns the value of thethreadNamePrefixrecord component.- Returns:
- the value of the
threadNamePrefixrecord component
-
factory
-