Class NewThreadScheduler
- java.lang.Object
-
- io.reactivex.rxjava3.core.Scheduler
-
- io.reactivex.rxjava3.internal.schedulers.NewThreadScheduler
-
public final class NewThreadScheduler extends Scheduler
Schedules work on a new thread.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.reactivex.rxjava3.core.Scheduler
Scheduler.Worker
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringKEY_NEWTHREAD_PRIORITYThe name of the system property for setting the thread priority for this Scheduler.private static RxThreadFactoryTHREAD_FACTORYprivate static java.lang.StringTHREAD_NAME_PREFIX(package private) java.util.concurrent.ThreadFactorythreadFactory
-
Constructor Summary
Constructors Constructor Description NewThreadScheduler()NewThreadScheduler(java.util.concurrent.ThreadFactory threadFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull Scheduler.WorkercreateWorker()Retrieves or creates a newScheduler.Workerthat represents sequential execution of actions.-
Methods inherited from class io.reactivex.rxjava3.core.Scheduler
clockDriftTolerance, now, scheduleDirect, scheduleDirect, schedulePeriodicallyDirect, shutdown, start, when
-
-
-
-
Field Detail
-
threadFactory
final java.util.concurrent.ThreadFactory threadFactory
-
THREAD_NAME_PREFIX
private static final java.lang.String THREAD_NAME_PREFIX
- See Also:
- Constant Field Values
-
THREAD_FACTORY
private static final RxThreadFactory THREAD_FACTORY
-
KEY_NEWTHREAD_PRIORITY
private static final java.lang.String KEY_NEWTHREAD_PRIORITY
The name of the system property for setting the thread priority for this Scheduler.- See Also:
- Constant Field Values
-
-
Method Detail
-
createWorker
@NonNull public @NonNull Scheduler.Worker createWorker()
Description copied from class:SchedulerRetrieves or creates a newScheduler.Workerthat represents sequential execution of actions.When work is completed, the
Workerinstance should be released by callingDisposable.dispose()to avoid potential resource leaks in the underlying task-execution scheme.Work on a
Scheduler.Workeris guaranteed to be sequential and non-overlapping.- Specified by:
createWorkerin classScheduler- Returns:
- a Worker representing a serial queue of actions to be executed
-
-