Use the dispose() to release the wrapped worker. This scheduler is time-capable if the worker itself is time-capable (can schedule with a delay and/or periodically).
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Scheduler. | createWorker()
Implements reactor. |
| public void | dispose()
Overrides default reactor. |
| public void | execute(Runnable
the runnable task command)Implements java. |
| 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 String |
| main | back to summary |
|---|---|
| pack-priv final Scheduler. | |
| SingleWorkerScheduler | back to summary |
|---|---|
| pack-priv SingleWorkerScheduler(Scheduler actual) | |
| createWorker | back to summary |
|---|---|
| public Scheduler. Implements reactor. Doc from reactor. Creates a worker of this Scheduler.
Once the Worker is no longer in use, one should call dispose() on it to
release any resources the particular Scheduler may have used.
It depends on the implementation, but Scheduler Workers should usually run tasks in
FIFO order. Some implementations may entirely delegate the scheduling to an
underlying structure (like an | |
| dispose | back to summary |
|---|---|
| public void dispose() Overrides default reactor. Doc from reactor. Instructs this Scheduler to release all resources and reject any new tasks to be executed. The operation is thread-safe. The Scheduler may choose to ignore this instruction. When used in combination with
| |
| execute | back to summary |
|---|---|
| public void execute(Runnable command) Implements java. Doc from java. Executes the given command at some time in the future. The command
may execute in a new thread, in a pooled thread, or in the calling
thread, at the discretion of the | |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Overrides default reactor. Doc from reactor. Optionally return true when the resource or task is disposed. Implementations are not required to track disposition and as such may never return true even when disposed. However, they MUST only return true when there's a guarantee the resource or task is disposed.
| |
| scanUnsafe | back to summary |
|---|---|
| public Object scanUnsafe(Scannable. Implements reactor. Doc from reactor. This method is used internally by components to define their key-value mappings
in a single place. Although it is ignoring the generic type of the
For public consumption of attributes, prefer using | |
| schedule | back to summary |
|---|---|
| public Disposable schedule(Runnable task) Implements reactor. Doc from reactor. Schedules the non-delayed execution of the given task on this scheduler. This method is safe to be called from multiple threads but there are no ordering guarantees between tasks.
| |
| schedule | back to summary |
|---|---|
| public Disposable schedule(Runnable task, long delay, TimeUnit unit) Overrides default reactor. Doc from reactor. Schedules the execution of the given task with the given delay amount. This method is safe to be called from multiple threads but there are no ordering guarantees between tasks.
| |
| schedulePeriodically | back to summary |
|---|---|
| public Disposable schedulePeriodically(Runnable task, long initialDelay, long period, TimeUnit unit) Overrides default reactor. Doc from reactor. Schedules a periodic execution of the given task with the given initial delay and 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 initial delay, the second after initialDelay + period, the third after initialDelay + 2 * period, and so on.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |