Scheduler Workers that are time-capable (implementing a
relevant schedule(delay) and schedulePeriodically(period) methods).
Unlike the one in DelegateServiceScheduler, this runnable doesn't expose the
ability to cancel inner task when interrupted.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Future | ASYNC_CANCELLED
marker that the Worker was cancelled from another thread, making it safe to interrupt the Future task. |
| pack-priv static final Disposable. | DISPOSED
marker that the Worker was disposed and the parent got notified |
| pack-priv static final Disposable. | DONE
marker that the Worker has completed, for the PARENT field |
| pack-priv static final Future | FINISHED
marker that the Worker has completed, for the FUTURE field |
| pack-priv volatile Future | |
| pack-priv static final AtomicReferenceFieldUpdater | |
| pack-priv volatile Disposable. | |
| pack-priv static final AtomicReferenceFieldUpdater | |
| pack-priv static final Future | SYNC_CANCELLED
marker that the Worker was cancelled from the same thread (ie. |
| pack-priv final Runnable | |
| pack-priv volatile Thread | |
| pack-priv static final AtomicReferenceFieldUpdater |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Void | call()
Implements java. |
| public void | dispose()
Implements reactor. |
| public boolean | isDisposed()
Overrides default reactor. |
| public void | |
| pack-priv void |
| ASYNC_CANCELLED | back to summary |
|---|---|
| pack-priv static final Future<Void> ASYNC_CANCELLED marker that the Worker was cancelled from another thread, making it safe to interrupt the Future task. | |
| DISPOSED | back to summary |
|---|---|
| pack-priv static final Disposable. marker that the Worker was disposed and the parent got notified | |
| DONE | back to summary |
|---|---|
| pack-priv static final Disposable. marker that the Worker has completed, for the PARENT field | |
| FINISHED | back to summary |
|---|---|
| pack-priv static final Future<Void> FINISHED marker that the Worker has completed, for the FUTURE field | |
| future | back to summary |
|---|---|
| pack-priv volatile Future<?> future | |
| FUTURE | back to summary |
|---|---|
| pack-priv static final AtomicReferenceFieldUpdater<WorkerTask, Future<V>> FUTURE | |
| parent | back to summary |
|---|---|
| pack-priv volatile Disposable. | |
| PARENT | back to summary |
|---|---|
| pack-priv static final AtomicReferenceFieldUpdater<WorkerTask, Disposable. | |
| SYNC_CANCELLED | back to summary |
|---|---|
| pack-priv static final Future<Void> SYNC_CANCELLED marker that the Worker was cancelled from the same thread (ie. within call()/run()), which means setFuture might race: we avoid interrupting the Future in this case. | |
| task | back to summary |
|---|---|
| pack-priv final Runnable task | |
| thread | back to summary |
|---|---|
| pack-priv volatile Thread thread | |
| THREAD | back to summary |
|---|---|
| pack-priv static final AtomicReferenceFieldUpdater<WorkerTask, Thread> THREAD | |
| WorkerTask | back to summary |
|---|---|
| pack-priv WorkerTask(Runnable task, Disposable. | |
| call | back to summary |
|---|---|
| public Void call() Implements java. Doc from java. Computes a result, or throws an exception if unable to do so. | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements reactor. Doc from reactor. Cancel or dispose the underlying task or resource. Implementations are required to make this method idempotent.
| |
| 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.
| |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| setFuture | back to summary |
|---|---|
| pack-priv void setFuture(Future<?> f) | |