Class SingleScheduler.ScheduledWorker
- java.lang.Object
-
- io.reactivex.rxjava3.core.Scheduler.Worker
-
- io.reactivex.rxjava3.internal.schedulers.SingleScheduler.ScheduledWorker
-
- All Implemented Interfaces:
Disposable
- Enclosing class:
- SingleScheduler
static final class SingleScheduler.ScheduledWorker extends Scheduler.Worker
-
-
Field Summary
Fields Modifier and Type Field Description (package private) booleandisposed(package private) java.util.concurrent.ScheduledExecutorServiceexecutor(package private) CompositeDisposabletasks
-
Constructor Summary
Constructors Constructor Description ScheduledWorker(java.util.concurrent.ScheduledExecutorService executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Dispose the resource, the operation should be idempotent.booleanisDisposed()Returns true if this resource has been disposed.@NonNull Disposableschedule(@NonNull java.lang.Runnable run, long delay, @NonNull java.util.concurrent.TimeUnit unit)Schedules an Runnable for execution at some point in the future specified by a time delay relative to the current time.-
Methods inherited from class io.reactivex.rxjava3.core.Scheduler.Worker
now, schedule, schedulePeriodically
-
-
-
-
Field Detail
-
executor
final java.util.concurrent.ScheduledExecutorService executor
-
tasks
final CompositeDisposable tasks
-
disposed
volatile boolean disposed
-
-
Method Detail
-
schedule
@NonNull public @NonNull Disposable schedule(@NonNull @NonNull java.lang.Runnable run, long delay, @NonNull @NonNull java.util.concurrent.TimeUnit unit)
Description copied from class:Scheduler.WorkerSchedules an Runnable for execution at some point in the future specified by a time delay relative to the current time.Note to implementors: non-positive
delayTimeshould be regarded as non-delayed schedule, i.e., as if theScheduler.Worker.schedule(Runnable)was called.- Specified by:
schedulein classScheduler.Worker- Parameters:
run- the Runnable to scheduledelay- time to "wait" before executing the action; non-positive values indicate an non-delayed scheduleunit- the time unit ofdelayTime- Returns:
- a Disposable to be able to unsubscribe the action (cancel it if not executed)
-
dispose
public void dispose()
Description copied from interface:DisposableDispose the resource, the operation should be idempotent.
-
isDisposed
public boolean isDisposed()
Description copied from interface:DisposableReturns true if this resource has been disposed.- Returns:
- true if this resource has been disposed
-
-