Top Description Fields Constructors Methods
io.reactivex.rxjava3.internal.schedulers

public final Class NewThreadScheduler

extends Scheduler
Class Inheritance
Imports
java.util.concurrent.ThreadFactory, io.reactivex.rxjava3.annotations.NonNull, io.reactivex.rxjava3.core.Scheduler

Schedules work on a new thread.

Field Summary

Modifier and TypeField and Description
private static final String
KEY_NEWTHREAD_PRIORITY

The name of the system property for setting the thread priority for this Scheduler.

private static final RxThreadFactory
private static final String
pack-priv final ThreadFactory

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public @NonNull Scheduler.Worker
createWorker()

Implements abstract io.reactivex.rxjava3.core.Scheduler.createWorker.

Retrieves or creates a new Scheduler.Worker that represents sequential execution of actions.
Inherited from io.reactivex.rxjava3.core.Scheduler:
clockDriftTolerancenowscheduleDirectscheduleDirectschedulePeriodicallyDirectshutdownstartwhen

Field Detail

KEY_NEWTHREAD_PRIORITYback to summary
private static final String KEY_NEWTHREAD_PRIORITY

The name of the system property for setting the thread priority for this Scheduler.

THREAD_FACTORYback to summary
private static final RxThreadFactory THREAD_FACTORY
THREAD_NAME_PREFIXback to summary
private static final String THREAD_NAME_PREFIX
threadFactoryback to summary
pack-priv final ThreadFactory threadFactory

Constructor Detail

NewThreadSchedulerback to summary
public NewThreadScheduler()
NewThreadSchedulerback to summary
public NewThreadScheduler(ThreadFactory threadFactory)

Method Detail

createWorkerback to summary
public @NonNull Scheduler.Worker createWorker()

Implements abstract io.reactivex.rxjava3.core.Scheduler.createWorker.

Doc from io.reactivex.rxjava3.core.Scheduler.createWorker.

Retrieves or creates a new Scheduler.Worker that represents sequential execution of actions.

When work is completed, the Worker instance should be released by calling Scheduler.Worker#dispose() to avoid potential resource leaks in the underlying task-execution scheme.

Work on a Scheduler.Worker is guaranteed to be sequential and non-overlapping.

Returns:@NonNull Scheduler.Worker

a Worker representing a serial queue of actions to be executed

Annotations
@NonNull
@Override