java.lang.Object | ||
↳ | io.reactivex.Scheduler | |
↳ | io.reactivex.schedulers.TestScheduler |
A special, non thread-safe scheduler for testing operators that require a scheduler without introducing real concurrency and allows manually advancing a virtual time.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TestScheduler() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
advanceTimeBy(long delayTime, TimeUnit unit)
Moves the Scheduler's clock forward by a specified amount of time.
| ||||||||||
void |
advanceTimeTo(long delayTime, TimeUnit unit)
Moves the Scheduler's clock to a particular moment in time.
| ||||||||||
Scheduler.Worker |
createWorker()
Retrieves or creates a new
Scheduler.Worker that represents serial execution of actions. | ||||||||||
long |
now(TimeUnit unit)
Returns the 'current time' of the Scheduler in the specified time unit.
| ||||||||||
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.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Moves the Scheduler's clock forward by a specified amount of time.
delayTime | the amount of time to move the Scheduler's clock forward |
---|---|
unit | the units of time that delayTime is expressed in
|
Moves the Scheduler's clock to a particular moment in time.
delayTime | the point in time to move the Scheduler's clock to |
---|---|
unit | the units of time that delayTime is expressed in
|
Retrieves or creates a new Scheduler.Worker
that represents serial execution of actions.
When work is completed it should be unsubscribed using dispose()
.
Work on a Scheduler.Worker
is guaranteed to be sequential.
Returns the 'current time' of the Scheduler in the specified time unit.
unit | the time unit |
---|
Triggers any actions that have not yet been triggered and that are scheduled to be triggered at or before this Scheduler's present time.