By default, the tasks submitted via the various schedule methods are not
wrapped by the RxJavaPlugins#onSchedule(Runnable) hook. To enable this behavior,
create a TestScheduler via TestScheduler(boolean) or TestScheduler(long, TimeUnit, boolean).
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv long | counter
The per-scheduler global order counter. |
| pack-priv final Queue | queue
The ordered queue for the runnable tasks. |
| pack-priv volatile long | |
| pack-priv final boolean | useOnScheduleHook
Use the |
| Access | Constructor and Description |
|---|---|
| public | |
| public | TestScheduler(boolean
if useOnScheduleHook)true, the tasks submitted to this
TestScheduler is wrapped via the
RxJavaPlugins#onSchedule(Runnable) hookCreates a new TestScheduler with the option to use the
|
| public | TestScheduler(long
the point in time to move the Scheduler's clock to delayTime, TimeUnit the units of time that unit)delayTime is expressed inCreates a new TestScheduler with the specified initial virtual time. |
| public | TestScheduler(long
the point in time to move the Scheduler's clock to delayTime, TimeUnit the units of time that unit, boolean delayTime is expressed inif useOnScheduleHook)true, the tasks submitted to this
TestScheduler is wrapped via the
RxJavaPlugins#onSchedule(Runnable) hookCreates a new TestScheduler with the specified initial virtual time
and with the option to use the
|
| Modifier and Type | Method and Description |
|---|---|
| public void | advanceTimeBy(long
the amount of time to move the Scheduler's clock forward delayTime, TimeUnit the units of time that unit)delayTime is expressed inMoves the Scheduler's clock forward by a specified amount of time. |
| public void | advanceTimeTo(long
the point in time to move the Scheduler's clock to delayTime, TimeUnit the units of time that unit)delayTime is expressed inMoves the Scheduler's clock to a particular moment in time. |
| public @NonNull Scheduler. | createWorker()
Implements abstract io. Scheduler. that represents sequential execution of actions.
|
| public long | |
| public void | triggerActions()
Triggers any actions that have not yet been triggered and that are scheduled to be triggered at or before this Scheduler's present time. |
| private void |
| counter | back to summary |
|---|---|
| pack-priv long counter The per-scheduler global order counter. | |
| queue | back to summary |
|---|---|
| pack-priv final Queue<TestScheduler. The ordered queue for the runnable tasks. | |
| time | back to summary |
|---|---|
| pack-priv volatile long time | |
| useOnScheduleHook | back to summary |
|---|---|
| pack-priv final boolean useOnScheduleHook Use the | |
| TestScheduler | back to summary |
|---|---|
| public TestScheduler() Creates a new TestScheduler with initial virtual time of zero. | |
| TestScheduler | back to summary |
|---|---|
| public TestScheduler(boolean useOnScheduleHook) Creates a new TestScheduler with the option to use the
History: 3.0.10 - experimental
| |
| TestScheduler | back to summary |
|---|---|
| public TestScheduler(long delayTime, TimeUnit unit) Creates a new TestScheduler with the specified initial virtual time.
| |
| TestScheduler | back to summary |
|---|---|
| public TestScheduler(long delayTime, TimeUnit unit, boolean useOnScheduleHook) Creates a new TestScheduler with the specified initial virtual time
and with the option to use the
History: 3.0.10 - experimental
| |
| advanceTimeBy | back to summary |
|---|---|
| public void advanceTimeBy(long delayTime, TimeUnit unit) Moves the Scheduler's clock forward by a specified amount of time.
| |
| advanceTimeTo | back to summary |
|---|---|
| public void advanceTimeTo(long delayTime, TimeUnit unit) Moves the Scheduler's clock to a particular moment in time.
| |
| createWorker | back to summary |
|---|---|
| public @NonNull Scheduler. Implements abstract io. Doc from io. Retrieves or creates a new
When work is completed, the
Work on a | |
| now | back to summary |
|---|---|
public long now(@NonNull TimeUnit unit)
| |
| triggerActions | back to summary |
|---|---|
| public void triggerActions() Triggers any actions that have not yet been triggered and that are scheduled to be triggered at or before this Scheduler's present time. | |
| triggerActions | back to summary |
|---|---|
| private void triggerActions(long targetTimeInNanoseconds) | |
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv volatile boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | dispose()
Implements io. |
| public boolean | isDisposed()
Implements io. |
| public long | |
| public @NonNull Disposable | |
| public @NonNull Disposable |
| disposed | back to summary |
|---|---|
| pack-priv volatile boolean disposed | |
| TestWorker | back to summary |
|---|---|
| pack-priv TestWorker() | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements io. Doc from io. Dispose the resource, the operation should be idempotent.
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Implements io. Doc from io. Returns true if this resource has been disposed.
| |
| now | back to summary |
|---|---|
public long now(@NonNull TimeUnit unit)
| |
| schedule | back to summary |
|---|---|
| public @NonNull Disposable schedule(@NonNull Runnable run, long delayTime, @NonNull TimeUnit unit) | |
| schedule | back to summary |
|---|---|
| public @NonNull Disposable schedule(@NonNull Runnable run) | |
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | dispose()
Implements io. |
| public boolean | isDisposed()
Implements io. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| QueueRemove | back to summary |
|---|---|
| pack-priv QueueRemove(TestScheduler. | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements io. Doc from io. Dispose the resource, the operation should be idempotent.
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Implements io. Doc from io. Returns true if this resource has been disposed.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final long | |
| pack-priv final Runnable | |
| pack-priv final TestScheduler. | |
| pack-priv final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(TestScheduler.
the object to be compared. oImplements java. |
| public String |
| count | back to summary |
|---|---|
| pack-priv final long count | |
| run | back to summary |
|---|---|
| pack-priv final Runnable run | |
| scheduler | back to summary |
|---|---|
| pack-priv final TestScheduler. | |
| time | back to summary |
|---|---|
| pack-priv final long time | |
| TimedRunnable | back to summary |
|---|---|
| pack-priv TimedRunnable(TestScheduler. | |
| compareTo | back to summary |
|---|---|
| public int compareTo(TestScheduler. Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |