RxJava



rx.schedulers
Class TrampolineScheduler

java.lang.Object
  extended by rx.Scheduler
      extended by rx.schedulers.TrampolineScheduler

public class TrampolineScheduler
extends Scheduler

Schedules work on the current thread but does not execute immediately. Work is put in a queue and executed after the current unit of work is completed.


Nested Class Summary
 
Nested classes/interfaces inherited from class rx.Scheduler
Scheduler.Inner, Scheduler.Recurse
 
Method Summary
static TrampolineScheduler getInstance()
          Deprecated. Use Schedulers.trampoline();
 Subscription schedule(Action1<Scheduler.Inner> action)
          Schedules an Action on a new Scheduler instance (typically another thread) for execution.
 Subscription schedule(Action1<Scheduler.Inner> action, long delayTime, java.util.concurrent.TimeUnit unit)
          Schedules an Action on a new Scheduler instance (typically another thread) for execution at some point in the future.
 
Methods inherited from class rx.Scheduler
degreeOfParallelism, now, schedulePeriodically, scheduleRecursive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

@Deprecated
public static TrampolineScheduler getInstance()
Deprecated. Use Schedulers.trampoline();

Returns:

schedule

public Subscription schedule(Action1<Scheduler.Inner> action)
Description copied from class: Scheduler
Schedules an Action on a new Scheduler instance (typically another thread) for execution.

Specified by:
schedule in class Scheduler
Parameters:
action - Action to schedule
Returns:
a subscription to be able to unsubscribe from action

schedule

public Subscription schedule(Action1<Scheduler.Inner> action,
                             long delayTime,
                             java.util.concurrent.TimeUnit unit)
Description copied from class: Scheduler
Schedules an Action on a new Scheduler instance (typically another thread) for execution at some point in the future.

Specified by:
schedule in class Scheduler
Parameters:
action - the Action to schedule
delayTime - time to wait before executing the action
unit - the time unit the delay time is given in
Returns:
a subscription to be able to unsubscribe from action