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

public final Class ImmediateThinScheduler

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

A Scheduler partially implementing the API by allowing only non-delayed, non-periodic task execution on the current thread immediately.

Note that this doesn't support recursive scheduling and disposing the returned Disposable has no effect (because when the schedule() method returns, the task has been already run).

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv static final Disposable
public static final Scheduler
INSTANCE

The singleton instance of the immediate (thin) scheduler.

pack-priv static final Scheduler.Worker

Constructor Summary

AccessConstructor and Description
private

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.
public @NonNull Disposable
public @NonNull Disposable
scheduleDirect(@NonNull Runnable run, long delay, TimeUnit unit)

public @NonNull Disposable
schedulePeriodicallyDirect(@NonNull Runnable run, long initialDelay, long period, TimeUnit unit)

Inherited from io.reactivex.rxjava3.core.Scheduler:
clockDriftTolerancenowscheduleDirectscheduleDirectschedulePeriodicallyDirectshutdownstartwhen

Field Detail

DISPOSEDback to summary
pack-priv static final Disposable DISPOSED
INSTANCEback to summary
public static final Scheduler INSTANCE

The singleton instance of the immediate (thin) scheduler.

WORKERback to summary
pack-priv static final Scheduler.Worker WORKER

Constructor Detail

ImmediateThinSchedulerback to summary
private ImmediateThinScheduler()

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
scheduleDirectback to summary
public @NonNull Disposable scheduleDirect(@NonNull Runnable run)
Annotations
@NonNull
@Override
scheduleDirectback to summary
public @NonNull Disposable scheduleDirect(@NonNull Runnable run, long delay, TimeUnit unit)
Annotations
@NonNull
@Override
schedulePeriodicallyDirectback to summary
public @NonNull Disposable schedulePeriodicallyDirect(@NonNull Runnable run, long initialDelay, long period, TimeUnit unit)
Annotations
@NonNull
@Override
io.reactivex.rxjava3.internal.schedulers back to summary

pack-priv final Class ImmediateThinScheduler.ImmediateThinWorker

extends Worker
Class Inheritance

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Implements io.reactivex.rxjava3.disposables.Disposable.dispose.

Dispose the resource, the operation should be idempotent.
public boolean
isDisposed()

Implements io.reactivex.rxjava3.disposables.Disposable.isDisposed.

Returns true if this resource has been disposed.
public @NonNull Disposable
public @NonNull Disposable
schedule(@NonNull Runnable run, long delay, @NonNull TimeUnit unit)

public @NonNull Disposable
schedulePeriodically(@NonNull Runnable run, long initialDelay, long period, TimeUnit unit)

Inherited from io.reactivex.rxjava3.core.Scheduler.Worker:
nowschedulescheduleschedulePeriodically

Constructor Detail

ImmediateThinWorkerback to summary
pack-priv ImmediateThinWorker()

Method Detail

disposeback to summary
public void dispose()

Implements io.reactivex.rxjava3.disposables.Disposable.dispose.

Doc from io.reactivex.rxjava3.disposables.Disposable.dispose.

Dispose the resource, the operation should be idempotent.

Annotations
@Override
isDisposedback to summary
public boolean isDisposed()

Implements io.reactivex.rxjava3.disposables.Disposable.isDisposed.

Doc from io.reactivex.rxjava3.disposables.Disposable.isDisposed.

Returns true if this resource has been disposed.

Returns:boolean

true if this resource has been disposed

Annotations
@Override
scheduleback to summary
public @NonNull Disposable schedule(@NonNull Runnable run)
Annotations
@NonNull
@Override
scheduleback to summary
public @NonNull Disposable schedule(@NonNull Runnable run, long delay, @NonNull TimeUnit unit)
Annotations
@NonNull
@Override
schedulePeriodicallyback to summary
public @NonNull Disposable schedulePeriodically(@NonNull Runnable run, long initialDelay, long period, TimeUnit unit)
Annotations
@NonNull
@Override