| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | KEY_COMPUTATION_PRIORITY
The name of the system property for setting the thread priority for this Scheduler. |
| pack-priv static final String | KEY_MAX_THREADS
Key to setting the maximum number of computation scheduler threads. |
| pack-priv static final int | MAX_THREADS
The maximum number of computation scheduler threads. |
| pack-priv static final ComputationScheduler. | NONE
This will indicate no pool is active. |
| pack-priv final AtomicReference | |
| pack-priv static final ComputationScheduler. | |
| pack-priv static final RxThreadFactory | |
| private static final String | THREAD_NAME_PREFIX
Manages a fixed number of workers. |
| pack-priv final ThreadFactory |
| Access | Constructor and Description |
|---|---|
| public | ComputationScheduler()
Create a scheduler with pool size equal to the available processor count and using least-recent worker selection policy. |
| public | ComputationScheduler(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)Create a scheduler with pool size equal to the available processor count and using least-recent worker selection policy. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static int | |
| public Scheduler. | createWorker()
Implements abstract io. Scheduler. that represents sequential execution of actions.
|
| public void | createWorkers(int
the number of workers to create, positive number, SchedulerMultiWorkerSupport.the callback to send worker instances to callbackImplements io. io. instances
that are possibly backed by distinct threads
and calls the specified Consumer with them.
|
| 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. |
| KEY_COMPUTATION_PRIORITY | back to summary |
|---|---|
| private static final String KEY_COMPUTATION_PRIORITY The name of the system property for setting the thread priority for this Scheduler. | |
| KEY_MAX_THREADS | back to summary |
|---|---|
| pack-priv static final String KEY_MAX_THREADS Key to setting the maximum number of computation scheduler threads. Zero or less is interpreted as use available. Capped by available. | |
| MAX_THREADS | back to summary |
|---|---|
| pack-priv static final int MAX_THREADS The maximum number of computation scheduler threads. | |
| NONE | back to summary |
|---|---|
| pack-priv static final ComputationScheduler. This will indicate no pool is active. | |
| pool | back to summary |
|---|---|
| pack-priv final AtomicReference<ComputationScheduler. | |
| SHUTDOWN_WORKER | back to summary |
|---|---|
| pack-priv static final ComputationScheduler. | |
| THREAD_FACTORY | back to summary |
|---|---|
| pack-priv static final RxThreadFactory THREAD_FACTORY | |
| THREAD_NAME_PREFIX | back to summary |
|---|---|
| private static final String THREAD_NAME_PREFIX Manages a fixed number of workers. | |
| threadFactory | back to summary |
|---|---|
| pack-priv final ThreadFactory threadFactory | |
| ComputationScheduler | back to summary |
|---|---|
| public ComputationScheduler() Create a scheduler with pool size equal to the available processor count and using least-recent worker selection policy. | |
| ComputationScheduler | back to summary |
|---|---|
| public ComputationScheduler(ThreadFactory threadFactory) Create a scheduler with pool size equal to the available processor count and using least-recent worker selection policy.
| |
| cap | back to summary |
|---|---|
| pack-priv static int cap(int cpuCount, int paramThreads) | |
| 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 | |
| createWorkers | back to summary |
|---|---|
| public void createWorkers(int number, SchedulerMultiWorkerSupport. Implements io. Doc from io. Creates the given number of
| |
| 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 |
|---|---|
| private final ListCompositeDisposable | |
| pack-priv volatile boolean | |
| private final ComputationScheduler. | |
| private final ListCompositeDisposable | |
| private 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
Runnable to schedule action)Overrides io. |
| public Disposable | schedule(Runnable
the Runnable to schedule action, long time to "wait" before executing the action; non-positive values indicate an non-delayed
schedule delayTime, TimeUnit the time unit of unit)delayTimeImplements abstract io. |
| both | back to summary |
|---|---|
| private final ListCompositeDisposable both | |
| disposed | back to summary |
|---|---|
| pack-priv volatile boolean disposed | |
| poolWorker | back to summary |
|---|---|
| private final ComputationScheduler. | |
| serial | back to summary |
|---|---|
| private final ListCompositeDisposable serial | |
| timed | back to summary |
|---|---|
| private final CompositeDisposable timed | |
| EventLoopWorker | back to summary |
|---|---|
| pack-priv EventLoopWorker(ComputationScheduler. | |
| 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 action) Overrides io. Doc from io. Schedules a Runnable for execution without any time delay. The default implementation delegates to
| |
| schedule | back to summary |
|---|---|
| public Disposable schedule(Runnable action, long delayTime, 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
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final int | |
| pack-priv final ComputationScheduler. | |
| pack-priv long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | createWorkers(int
the number of workers to create, positive number, SchedulerMultiWorkerSupport.the callback to send worker instances to callbackImplements io. io. instances
that are possibly backed by distinct threads
and calls the specified Consumer with them.
|
| public ComputationScheduler. | |
| public void |
| cores | back to summary |
|---|---|
| pack-priv final int cores | |
| eventLoops | back to summary |
|---|---|
| pack-priv final ComputationScheduler. | |
| n | back to summary |
|---|---|
| pack-priv long n | |
| FixedSchedulerPool | back to summary |
|---|---|
| pack-priv FixedSchedulerPool(int maxThreads, ThreadFactory threadFactory) | |
| createWorkers | back to summary |
|---|---|
| public void createWorkers(int number, SchedulerMultiWorkerSupport. Implements io. Doc from io. Creates the given number of
| |
| getEventLoop | back to summary |
|---|---|
| public ComputationScheduler. | |
| shutdown | back to summary |
|---|---|
| public void shutdown() | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| PoolWorker | back to summary |
|---|---|
| pack-priv PoolWorker(ThreadFactory threadFactory) | |