Class SequentialExecutor.QueueWorker
java.lang.Object
com.google.common.util.concurrent.SequentialExecutor.QueueWorker
- All Implemented Interfaces:
Runnable
- Enclosing class:
SequentialExecutor
Worker that runs tasks from
SequentialExecutor.queue
until it is empty.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
run()
toString()
private void
Continues executing tasks fromSequentialExecutor.queue
until it is empty.
-
Field Details
-
task
-
-
Constructor Details
-
QueueWorker
private QueueWorker()
-
-
Method Details
-
run
public void run() -
workOnQueue
private void workOnQueue()Continues executing tasks fromSequentialExecutor.queue
until it is empty.The thread's interrupt bit is cleared before execution of each task.
If the Thread in use is interrupted before or during execution of the tasks in
SequentialExecutor.queue
, the Executor will complete its tasks, and then restore the interruption. This means that once the Thread returns to the Executor that this Executor composes, the interruption will still be present. If the composed Executor is an ExecutorService, it can respond to shutdown() by returning tasks queued on that Thread afterSequentialExecutor.worker
drains the queue. -
toString
-