|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrx.Scheduler
public abstract class Scheduler
Represents an object that schedules units of work.
The methods left to implement are:
<T> Subscription schedule(T state, Func2<Scheduler, T, Subscription> action, long delayTime, TimeUnit unit)<T> Subscription schedule(T state, Func2<Scheduler, T, Subscription> action)Why is this an abstract class instead of an interface?
| Constructor Summary | |
|---|---|
Scheduler()
|
|
| Method Summary | ||
|---|---|---|
int |
degreeOfParallelism()
Parallelism available to a Scheduler. |
|
long |
now()
|
|
Subscription |
schedule(Action0 action)
Schedules an action to be executed. |
|
Subscription |
schedule(Action0 action,
long delayTime,
java.util.concurrent.TimeUnit unit)
Schedules an action to be executed in delayTime. |
|
Subscription |
schedule(Action1<Action0> action)
Schedules an action and receives back an action for recursive execution. |
|
abstract
|
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,
java.util.Date dueTime)
Schedules a cancelable action to be executed at dueTime. |
|
abstract
|
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. |
|
Subscription |
schedulePeriodically(Action0 action,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit)
Schedules an action to be executed periodically. |
|
|
schedulePeriodically(T state,
Func2<? super Scheduler,? super T,? extends Subscription> action,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit)
Schedules a cancelable action to be executed periodically. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Scheduler()
| Method Detail |
|---|
public abstract <T> Subscription schedule(T state,
Func2<? super Scheduler,? super T,? extends Subscription> action)
state - State to pass into the action.action - Action to schedule.
public abstract <T> Subscription schedule(T state,
Func2<? super Scheduler,? super T,? extends Subscription> action,
long delayTime,
java.util.concurrent.TimeUnit unit)
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.
public <T> Subscription schedulePeriodically(T state,
Func2<? super Scheduler,? super T,? extends Subscription> action,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit)
state - State to pass into the action.action - The action to execute periodically.initialDelay - Time to wait before executing the action for the first time.period - The time interval to wait each time in between executing the action.unit - The time unit the interval above is given in.
public <T> Subscription schedule(T state,
Func2<? super Scheduler,? super T,? extends Subscription> action,
java.util.Date dueTime)
state - State to pass into the action.action - Action to schedule.dueTime - Time the action is to be executed. If in the past it will be executed immediately.
public Subscription schedule(Action1<Action0> action)
action - action
public Subscription schedule(Action0 action)
action - action
public Subscription schedule(Action0 action,
long delayTime,
java.util.concurrent.TimeUnit unit)
action - action
public Subscription schedulePeriodically(Action0 action,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit)
action - The action to execute periodically.initialDelay - Time to wait before executing the action for the first time.period - The time interval to wait each time in between executing the action.unit - The time unit the interval above is given in.
public long now()
public int degreeOfParallelism()
This defaults to Runtime.getRuntime().availableProcessors() but can be overridden for use cases such as scheduling work on a computer cluster.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||