BoundedScheduledExecutorService and exposes workers
backed by these executors, making it suited for moderate amount of blocking work. Note that requests for workers
will pick an executor in a round-robin fashion, so tasks from a given worker might arbitrarily be impeded by
long-running tasks of a sibling worker (and tasks are pinned to a given executor, so they won't be stolen
by an idle executor).
This scheduler is time-capable (can schedule with delay / periodically).
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | BoundedElasticScheduler.BoundedScheduledExecutorService
A |
| pack-priv static class | |
| pack-priv static class | BoundedElasticScheduler.BoundedState
A class that encapsulate state around the |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Clock | |
| pack-priv static final AtomicLong | |
| pack-priv static final int | |
| pack-priv final ThreadFactory | |
| private static final SchedulerState | |
| pack-priv static final Logger | |
| pack-priv final int | |
| pack-priv final int | |
| pack-priv volatile SchedulerState | |
| pack-priv static final AtomicReferenceFieldUpdater | |
| pack-priv final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | BoundedElasticScheduler(int maxThreads, int maxTaskQueuedPerThread, ThreadFactory threadFactory, long ttlMillis, Clock clock)
This constructor lets define millisecond-grained TTLs and a custom |
| pack-priv | BoundedElasticScheduler(int
the maximum number of backing threads to spawn, must be strictly positive maxThreads, int the maximum amount of tasks an executor can queue up maxTaskQueuedPerThread, ThreadFactory the factory, int ThreadFactory to name the backing threadsthe time-to-live (TTL) of idle threads, in seconds ttlSeconds)Create a |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | await(BoundedElasticScheduler.
Implements reactor. |
| pack-priv BoundedElasticScheduler. | createBoundedExecutorService()
Instantiates the default |
| public Scheduler. | createWorker()
Implements reactor. |
| public void | dispose()
Overrides default reactor. |
| public Mono | disposeGracefully()
Overrides default reactor. dispose() that also allows for graceful cleanup
of underlying resources.
|
| pack-priv int | |
| pack-priv int | |
| pack-priv int | Returns: the total task capacity, or -1 if any backing executor's task queue size cannot be instrumentedBest effort snapshot of the remaining queue capacity for pending tasks across all the backing executors. |
| pack-priv int | |
| public void | init()
Overrides default reactor. Workers.
|
| public Stream | inners()
Overrides default reactor. Stream of referenced inners (flatmap, multicast etc)
|
| public boolean | isDisposed()
Overrides default reactor. |
| public Object | scanUnsafe(Scannable.
a keyAttr to resolve for the component.Implements reactor. |
| public Disposable | schedule(Runnable
the task to execute task)Implements reactor. |
| public Disposable | schedule(Runnable
the task to schedule task, long the delay amount, non-positive values indicate non-delayed scheduling delay, TimeUnit the unit of measure of the delay amount unit)Overrides default reactor. |
| public Disposable | schedulePeriodically(Runnable
the task to schedule task, 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 default reactor. |
| public void | start()
Overrides default reactor. |
| public String |