| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final AtomicReference | |
| private static final String | KEY_SINGLE_PRIORITY
The name of the system property for setting the thread priority for this Scheduler. |
| pack-priv static final ScheduledExecutorService | |
| pack-priv static final RxThreadFactory | |
| private static final String | |
| pack-priv final ThreadFactory |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SingleScheduler(ThreadFactory
thread factory to use for creating worker threads. Note that this takes precedence over any
system properties for configuring new thread creation. Cannot be null. threadFactory)Constructs a SingleScheduler with the given ThreadFactory and prepares the single scheduler thread. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static ScheduledExecutorService | |
| public Scheduler. | createWorker()
Implements abstract io. Scheduler. that represents sequential execution of actions.
|
| public Disposable | scheduleDirect(Runnable
the task to schedule run, long the delay amount, non-positive values indicate non-delayed scheduling delay, TimeUnit the unit of measure of the delay amount unit)Overrides io. |
| public Disposable | schedulePeriodicallyDirect(Runnable
the task to schedule run, long the initial delay amount, non-positive values indicate non-delayed scheduling initialDelay, long the period at which the task should be re-executed period, TimeUnit the unit of measure of the delay amount unit)Overrides io. |
| public void | shutdown()
Overrides io. Worker instances
and clean up any associated resources with this Scheduler.
|
| public void | start()
Overrides io. |
| executor | back to summary |
|---|---|
| pack-priv final AtomicReference<ScheduledExecutorService> executor | |
| KEY_SINGLE_PRIORITY | back to summary |
|---|---|
| private static final String KEY_SINGLE_PRIORITY The name of the system property for setting the thread priority for this Scheduler. | |
| SHUTDOWN | back to summary |
|---|---|
| pack-priv static final ScheduledExecutorService SHUTDOWN | |
| SINGLE_THREAD_FACTORY | back to summary |
|---|---|
| pack-priv static final RxThreadFactory SINGLE_THREAD_FACTORY | |
| THREAD_NAME_PREFIX | back to summary |
|---|---|
| private static final String THREAD_NAME_PREFIX | |
| threadFactory | back to summary |
|---|---|
| pack-priv final ThreadFactory threadFactory | |
| SingleScheduler | back to summary |
|---|---|
| public SingleScheduler() | |
| SingleScheduler | back to summary |
|---|---|
| public SingleScheduler(ThreadFactory threadFactory) Constructs a SingleScheduler with the given ThreadFactory and prepares the single scheduler thread.
| |
| createExecutor | back to summary |
|---|---|
| pack-priv static ScheduledExecutorService createExecutor(ThreadFactory threadFactory) | |
| createWorker | back to summary |
|---|---|
| public Scheduler. Implements abstract io. Doc from io. Retrieves or creates a new
When work is completed, the
Work on a | |
| scheduleDirect | back to summary |
|---|---|
| public Disposable scheduleDirect(Runnable run, long delay, TimeUnit unit) Overrides io. Doc from io. Schedules the execution of the given task with the given time delay. This method is safe to be called from multiple threads but there are no ordering guarantees between tasks.
| |
| schedulePeriodicallyDirect | back to summary |
|---|---|
| public Disposable schedulePeriodicallyDirect(Runnable run, long initialDelay, long period, TimeUnit unit) Overrides io. Doc from io. Schedules a periodic execution of the given task with the given initial time delay and repeat period. This method is safe to be called from multiple threads but there are no ordering guarantees between tasks.
The periodic execution is at a fixed rate, that is, the first execution will be after the
| |
| shutdown | back to summary |
|---|---|
| public void shutdown() Overrides io. Doc from io. Instructs the Scheduler instance to stop threads,
stop accepting tasks on any outstanding
Implementations should make sure the call is idempotent, thread-safe and
should not throw any
| |
| start | back to summary |
|---|---|
| public void start() Overrides io. Doc from io. Allows the Scheduler instance to start threads and accept tasks on them.
Implementations should make sure the call is idempotent, thread-safe and
should not throw any
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv volatile boolean | |
| pack-priv final ScheduledExecutorService | |
| pack-priv final CompositeDisposable |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | dispose()
Implements io. |
| public boolean | isDisposed()
Implements io. |
| public Disposable | schedule(Runnable
the Runnable to schedule run, long time to "wait" before executing the action; non-positive values indicate an non-delayed
schedule delay, TimeUnit the time unit of unit)delayTimeImplements abstract io. |
| disposed | back to summary |
|---|---|
| pack-priv volatile boolean disposed | |
| executor | back to summary |
|---|---|
| pack-priv final ScheduledExecutorService executor | |
| tasks | back to summary |
|---|---|
| pack-priv final CompositeDisposable tasks | |
| ScheduledWorker | back to summary |
|---|---|
| pack-priv ScheduledWorker(ScheduledExecutorService executor) | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements io. Doc from io. Dispose the resource, the operation should be idempotent.
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Implements io. Doc from io. Returns true if this resource has been disposed.
| |
| schedule | back to summary |
|---|---|
| public Disposable schedule(Runnable run, long delay, TimeUnit unit) Implements abstract io. Doc from io. Schedules an Runnable for execution at some point in the future specified by a time delay relative to the current time.
Note to implementors: non-positive
| |