RxJava Android
rx.android.concurrency
Class HandlerThreadScheduler
java.lang.Object
rx.Scheduler
rx.android.concurrency.HandlerThreadScheduler
public class HandlerThreadScheduler
- extends rx.Scheduler
Schedules actions to run on an Android Handler thread.
|
Method Summary |
|
schedule(T state,
rx.util.functions.Func2<? super rx.Scheduler,? super T,? extends rx.Subscription> action)
Calls HandlerThreadScheduler.schedule(Object, rx.util.functions.Func2, long, java.util.concurrent.TimeUnit)
with a delay of zero milliseconds. |
|
schedule(T state,
rx.util.functions.Func2<? super rx.Scheduler,? super T,? extends rx.Subscription> action,
long delayTime,
java.util.concurrent.TimeUnit unit)
Calls Handler.postDelayed(Runnable, long) with a runnable that executes the given action. |
| Methods inherited from class rx.Scheduler |
now, schedule, schedule, schedule, schedulePeriodically, schedulePeriodically |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HandlerThreadScheduler
public HandlerThreadScheduler(android.os.Handler handler)
- Constructs a
HandlerThreadScheduler using the given Handler
- Parameters:
handler - Handler to use when scheduling actions
schedule
public <T> rx.Subscription schedule(T state,
rx.util.functions.Func2<? super rx.Scheduler,? super T,? extends rx.Subscription> action)
- Calls
HandlerThreadScheduler.schedule(Object, rx.util.functions.Func2, long, java.util.concurrent.TimeUnit)
with a delay of zero milliseconds.
See HandlerThreadScheduler.schedule(Object, rx.util.functions.Func2, long, java.util.concurrent.TimeUnit)
- Specified by:
schedule in class rx.Scheduler
schedule
public <T> rx.Subscription schedule(T state,
rx.util.functions.Func2<? super rx.Scheduler,? super T,? extends rx.Subscription> action,
long delayTime,
java.util.concurrent.TimeUnit unit)
- Calls
Handler.postDelayed(Runnable, long) with a runnable that executes the given action.
- Specified by:
schedule in class rx.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 from which one can unsubscribe from.