public abstract static class Scheduler.Worker extends Objectimplements Subscription
Unsubscribing the Scheduler.Worker unschedules 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
Schedules an Action for execution.
|
abstract Subscription |
schedule(Action0
Schedules an Action for execution at some point in the future.
|
Subscription |
schedulePeriodically(Action0
Schedules a cancelable action to be executed periodically.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisUnsubscribed, unsubscribepublic abstract Subscriptionschedule(Action0 action)
action - Action to schedule
public abstract Subscriptionschedule(Action0 action, long delayTime, TimeUnit unit)
Note to implementors: non-positive delayTime should be regarded as undelayed schedule, i.e., as if the schedule(rx.functions.Action0) was called.
action - the Action to schedule
delayTime - time to wait before executing the action; non-positive values indicate an undelayed schedule
unit - the time unit of
delayTime
public SubscriptionschedulePeriodically(Action0 action, long initialDelay, long period, TimeUnit unit)
Note to implementors: non-positive initialTime and period should be regarded as undelayed scheduling of the first and any subsequent executions.
action - the Action to execute periodically
initialDelay - time to wait before executing the action for the first time; non-positive values indicate an undelayed schedule
period - the time interval to wait each time in between executing the action; non-positive values indicate no delay between repeated schedules
unit - the time unit of
period
public long now()