ScheduledExecutorService that can be used for scheduling actions when a Scheduler implementation doesn't have that ability.
For example if a Scheduler is given an Executor or {ExecutorService instead of ScheduledExecutorService.
Note
No actual work should be done on tasks submitted to this executor. Submit a task with the appropriate delay which then in turn invokes
the work asynchronously on the appropriate Scheduler implementation. This means for example that you would not use this approach
along with TrampolineScheduler or ImmediateScheduler.
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicReference | |
| public static final GenericScheduledExecutorService | |
| private static final ScheduledExecutorService[] | |
| private static int | roundRobin
We don't use atomics with this because thread-assignment is random anyway. |
| private static final ScheduledExecutorService |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ScheduledExecutorService | Returns: ScheduledExecutorService for generic use.Returns one of the single-threaded ScheduledExecutorService helper executors. |
| public void | shutdown()
Implements rx. |
| public void | start()
Implements rx. |
| executor | back to summary |
|---|---|
| private final AtomicReference<ScheduledExecutorService[]> executor | |
| INSTANCE | back to summary |
|---|---|
| public static final GenericScheduledExecutorService INSTANCE | |
| NONE | back to summary |
|---|---|
| private static final ScheduledExecutorService[] NONE | |
| roundRobin | back to summary |
|---|---|
| private static int roundRobin We don't use atomics with this because thread-assignment is random anyway. | |
| SHUTDOWN | back to summary |
|---|---|
| private static final ScheduledExecutorService SHUTDOWN | |
| GenericScheduledExecutorService | back to summary |
|---|---|
| private GenericScheduledExecutorService() | |
| getInstance | back to summary |
|---|---|
| public static ScheduledExecutorService getInstance() Returns one of the single-threaded ScheduledExecutorService helper executors.
| |
| shutdown | back to summary |
|---|---|
| public void shutdown() Implements rx. Doc from rx. Instructs the Scheduler instance to stop threads and stop accepting tasks on any outstanding Workers. Implementations should make sure the call is idempotent and thread-safe.
| |
| start | back to summary |
|---|---|
| public void start() Implements rx. Doc from rx. Allows the Scheduler instance to start threads and accept tasks on them. Implementations should make sure the call is idempotent and thread-safe.
| |