RxJava
rx.concurrency
Class TestScheduler
java.lang.Object
rx.Scheduler
rx.concurrency.TestScheduler
public class TestScheduler
- extends Scheduler
|
Method Summary |
void |
advanceTimeBy(long delayTime,
java.util.concurrent.TimeUnit unit)
|
void |
advanceTimeTo(long delayTime,
java.util.concurrent.TimeUnit unit)
|
long |
now()
Returns the scheduler's notion of current absolute time in milliseconds. |
|
schedule(T state,
Func2<? super Scheduler,? super T,? extends Subscription> action)
Schedules a cancelable action to be executed. |
|
schedule(T state,
Func2<? super Scheduler,? super T,? extends Subscription> action,
long delayTime,
java.util.concurrent.TimeUnit unit)
Schedules a cancelable action to be executed in delayTime. |
void |
triggerActions()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TestScheduler
public TestScheduler()
now
public long now()
- Description copied from class:
Scheduler
- Returns the scheduler's notion of current absolute time in milliseconds.
- Overrides:
now in class Scheduler
advanceTimeBy
public void advanceTimeBy(long delayTime,
java.util.concurrent.TimeUnit unit)
advanceTimeTo
public void advanceTimeTo(long delayTime,
java.util.concurrent.TimeUnit unit)
triggerActions
public void triggerActions()
schedule
public <T> Subscription schedule(T state,
Func2<? super Scheduler,? super T,? extends Subscription> action)
- Description copied from class:
Scheduler
- Schedules a cancelable action to be executed.
- Specified by:
schedule in class Scheduler
- Parameters:
state - State to pass into the action.action - Action to schedule.
- Returns:
- a subscription to be able to unsubscribe from action.
schedule
public <T> Subscription schedule(T state,
Func2<? super Scheduler,? super T,? extends Subscription> action,
long delayTime,
java.util.concurrent.TimeUnit unit)
- Description copied from class:
Scheduler
- Schedules a cancelable action to be executed in delayTime.
- Specified by:
schedule in class Scheduler
- Parameters:
state - State to pass into the action.action - Action to schedule.delayTime - Time the action is to be delayed before executing.unit - Time unit of the delay time.
- Returns:
- a subscription to be able to unsubscribe from action.