Package hudson.util
Class SequentialExecutionQueue
java.lang.Object
hudson.util.SequentialExecutionQueue
- All Implemented Interfaces:
Executor
Executor
that collapses two equal Runnable
s into one,
and makes sure no two equal Runnable
s get executed simultaneously.
That is, if a Runnable
is executing and another one gets submitted,
the 2nd one waits for the completion of the 1st one.
Object.equals(Object)
is used on Runnable
to identify
two equal Runnable
s.
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Gets the base underlying executors.,GetsRunnable
s that are currently executed by a live thread.boolean
isStarving
(long threshold) Returns true if too much time is spent since someRunnable
is submitted into the queue until they get executed.void
Starts using a newExecutorService
to carry out executions.
-
Constructor Details
-
SequentialExecutionQueue
-
-
Method Details
-
getExecutors
Gets the base underlying executors., -
setExecutors
Starts using a newExecutorService
to carry out executions.The older
ExecutorService
will be shut down (but it's still expected to complete whatever they are doing and scheduled.) -
execute
-
isStarving
public boolean isStarving(long threshold) Returns true if too much time is spent since someRunnable
is submitted into the queue until they get executed. -
getInProgress
GetsRunnable
s that are currently executed by a live thread.
-