Class SequentialExecutor.QueueWorker
- java.lang.Object
-
- com.google.common.util.concurrent.SequentialExecutor.QueueWorker
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- SequentialExecutor
private final class SequentialExecutor.QueueWorker extends java.lang.Object implements java.lang.RunnableWorker that runs tasks fromSequentialExecutor.queueuntil it is empty.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateQueueWorker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()private voidworkOnQueue()Continues executing tasks fromSequentialExecutor.queueuntil it is empty.
-
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
workOnQueue
private void workOnQueue()
Continues executing tasks fromSequentialExecutor.queueuntil 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.workerdrains the queue.
-
-