Package io.reactivex.rxjava3.schedulers
Class TestScheduler.TestWorker
java.lang.Object
io.reactivex.rxjava3.core.Scheduler.Worker
io.reactivex.rxjava3.schedulers.TestScheduler.TestWorker
- All Implemented Interfaces:
Disposable
- Enclosing class:
TestScheduler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) final class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Dispose the resource, the operation should be idempotent.boolean
Returns true if this resource has been disposed.long
Returns the 'current time' of the Worker in the specified time unit.Schedules a Runnable for execution without any time delay.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
schedulePeriodically
-
Field Details
-
disposed
volatile boolean disposed
-
-
Constructor Details
-
TestWorker
TestWorker()
-
-
Method Details
-
dispose
public void dispose()Description copied from interface:Disposable
Dispose the resource, the operation should be idempotent. -
isDisposed
public boolean isDisposed()Description copied from interface:Disposable
Returns true if this resource has been disposed.- Returns:
- true if this resource has been disposed
-
schedule
@NonNull public @NonNull Disposable schedule(@NonNull @NonNull Runnable run, long delayTime, @NonNull @NonNull TimeUnit unit) Description copied from class:Scheduler.Worker
Schedules 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
delayTime
should be regarded as non-delayed schedule, i.e., as if theScheduler.Worker.schedule(Runnable)
was called.- Specified by:
schedule
in classScheduler.Worker
- Parameters:
run
- the Runnable to scheduledelayTime
- 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)
-
schedule
Description copied from class:Scheduler.Worker
Schedules a Runnable for execution without any time delay.The default implementation delegates to
Scheduler.Worker.schedule(Runnable, long, TimeUnit)
.- Overrides:
schedule
in classScheduler.Worker
- Parameters:
run
- Runnable to schedule- Returns:
- a Disposable to be able to unsubscribe the action (cancel it if not executed)
-
now
Description copied from class:Scheduler.Worker
Returns the 'current time' of the Worker in the specified time unit.- Overrides:
now
in classScheduler.Worker
- Parameters:
unit
- the time unit- Returns:
- the 'current time'
-