RxJava
rx.concurrency
Class ExecutorScheduler
java.lang.Object
rx.Scheduler
rx.concurrency.ExecutorScheduler
public class ExecutorScheduler
- extends Scheduler
A Scheduler implementation that uses an Executor or ScheduledExecutorService implementation.
Note that if an Executor implementation is used instead of ScheduledExecutorService then a system-wide Timer will be used to handle delayed events.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExecutorScheduler
public ExecutorScheduler(java.util.concurrent.Executor executor)
ExecutorScheduler
public ExecutorScheduler(java.util.concurrent.ScheduledExecutorService executor)
schedule
public <T> Subscription schedule(T state,
Func2<Scheduler,T,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.
schedule
public <T> Subscription schedule(T state,
Func2<Scheduler,T,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.