public abstract static class Scheduler.Worker extends java.lang.Object implements Subscription
Unsubscribing the Scheduler.Worker cancels all outstanding work and allows resources cleanup.
| Constructor and Description |
|---|
Worker() |
| Modifier and Type | Method and Description |
|---|---|
long |
now()
Gets the current time, in milliseconds, according to this Scheduler.
|
abstract Subscription |
schedule(Action0 action)
Schedules an Action for execution.
|
abstract Subscription |
schedule(Action0 action,
long delayTime,
java.util.concurrent.TimeUnit unit)
Schedules an Action for execution at some point in the future.
|
Subscription |
schedulePeriodically(Action0 action,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit)
Schedules a cancelable action to be executed periodically.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisUnsubscribed, unsubscribepublic abstract Subscription schedule(Action0 action)
action - Action to schedulepublic abstract Subscription schedule(Action0 action, long delayTime, java.util.concurrent.TimeUnit unit)
Note to implementors: non-positive delayTime should be regarded as non-delayed schedule, i.e.,
as if the schedule(rx.functions.Action0) was called.
action - the Action to scheduledelayTime - time to wait before executing the action; non-positive values indicate an non-delayed
scheduleunit - the time unit of delayTimepublic Subscription schedulePeriodically(Action0 action, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
Note to implementors: non-positive initialTime and period should be regarded as
non-delayed scheduling of the first and any subsequent executions.
action - the Action to execute periodicallyinitialDelay - time to wait before executing the action for the first time; non-positive values indicate
an non-delayed scheduleperiod - the time interval to wait each time in between executing the action; non-positive values
indicate no delay between repeated schedulesunit - the time unit of periodpublic long now()