RxJava



rx.concurrency
Class NewThreadScheduler

java.lang.Object
  extended by rx.concurrency.NewThreadScheduler
All Implemented Interfaces:
Scheduler

public class NewThreadScheduler
extends java.lang.Object

Schedules work on a new thread.


Constructor Summary
NewThreadScheduler()
           
 
Method Summary
static NewThreadScheduler getInstance()
           
 long now()
          Returns the scheduler's notion of current time.
 Subscription schedule(Action0 action)
          Schedules an action to be executed.
 Subscription schedule(Action0 action, long dueTime, java.util.concurrent.TimeUnit unit)
          Schedules an action to be executed in dueTime.
 Subscription schedule(Func0<Subscription> action)
          Schedules a cancelable action to be executed.
 Subscription schedule(Func0<Subscription> action, long dueTime, java.util.concurrent.TimeUnit unit)
          Schedules a cancelable action to be executed in dueTime.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewThreadScheduler

public NewThreadScheduler()
Method Detail

getInstance

public static NewThreadScheduler getInstance()

schedule

public Subscription schedule(Func0<Subscription> action)
Description copied from interface: Scheduler
Schedules a cancelable action to be executed.

Parameters:
action - action
Returns:
a subscription to be able to unsubscribe from action.

schedule

public Subscription schedule(Func0<Subscription> action,
                             long dueTime,
                             java.util.concurrent.TimeUnit unit)
Description copied from interface: Scheduler
Schedules a cancelable action to be executed in dueTime.

Parameters:
action - action
Returns:
a subscription to be able to unsubscribe from action.

schedule

public Subscription schedule(Action0 action)
Description copied from interface: Scheduler
Schedules an action to be executed.

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

schedule

public Subscription schedule(Action0 action,
                             long dueTime,
                             java.util.concurrent.TimeUnit unit)
Description copied from interface: Scheduler
Schedules an action to be executed in dueTime.

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

now

public long now()
Description copied from interface: Scheduler
Returns the scheduler's notion of current time.

Specified by:
now in interface Scheduler