| java.lang.Object | |
| ↳ | io.reactivex.Scheduler.Worker |
Sequential Scheduler for executing actions on a single thread or event loop.
Disposing the Scheduler.Worker cancels all outstanding work and allows resource cleanup.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Worker() | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| long |
now(TimeUnit unit)
Returns the 'current time' of the Worker in the specified time unit.
| ||||||||||
| Disposable |
schedule(Runnable run)
Schedules a Runnable for execution without delay.
| ||||||||||
| abstract Disposable |
schedule(Runnable run, long delay, TimeUnit unit)
Schedules an Runnable for execution at some point in the future.
| ||||||||||
| Disposable |
schedulePeriodically(Runnable run, long initialDelay, long period, TimeUnit unit)
Schedules a cancelable action to be executed periodically.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
io.reactivex.disposables.Disposable
| |||||||||||
Returns the 'current time' of the Worker in the specified time unit.
| unit | the time unit |
|---|
Schedules a Runnable for execution without delay.
The default implementation delegates to schedule(Runnable, long, TimeUnit).
| run | Runnable to schedule |
|---|
Schedules an Runnable for execution at some point in the future.
Note to implementors: non-positive delayTime should be regarded as non-delayed schedule, i.e.,
as if the schedule(Runnable) was called.
| run | the Runnable to schedule |
|---|---|
| delay | time to wait before executing the action; non-positive values indicate an non-delayed schedule |
| unit | the time unit of delayTime |
Schedules a cancelable action to be executed periodically. This default implementation schedules recursively and waits for actions to complete (instead of potentially executing long-running actions concurrently). Each scheduler that can do periodic scheduling in a better way should override this.
Note to implementors: non-positive initialTime and period should be regarded as
non-delayed scheduling of the first and any subsequent executions.
| run | the Runnable to execute periodically |
|---|---|
| initialDelay | time to wait before executing the action for the first time; non-positive values indicate an non-delayed 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 |