Package hudson.model.queue
Class QueueListener
java.lang.Object
hudson.model.queue.QueueListener
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
Queue.Saver
Listener for events in
Queue
.
Queue
is highly synchronized objects, and these callbacks are invoked synchronously.
To avoid the risk of deadlocks and general slow down, please minimize the amount of work callbacks
will perform, and push any sizable work to asynchronous execution via Executor
, such as
Computer.threadPoolForRemoting
.
For the state transition of Queue.Item
in Queue
, please refer to the Queue javadoc.
- Since:
- 1.520
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExtensionList<QueueListener>
all()
Returns all the registeredQueueListener
s.void
An item enters the blocked phase when there's someone saying "NO" to it proceeding to the buildable phase, such asQueueTaskDispatcher
.void
An item enters the buildable phase when all signals are green (or blue!) and it's just waiting for the scheduler to allocate it to the available executor.void
When a task is submitted to the queue, it first gets to the waiting phase, where it spends until the quiet period runs out and the item becomes executable.void
An item leaves the blocked phase and becomes buildable when there's no one vetoing.void
An item leaves the buildable phase.void
An item leaves the waiting phase when the current time of the system is past its due date.void
onLeft
(Queue.LeftItem li) The item has left the queue, either by gettingcancelled
or by getting picked up by an executor and starts running.
-
Constructor Details
-
QueueListener
public QueueListener()
-
-
Method Details
-
onEnterWaiting
When a task is submitted to the queue, it first gets to the waiting phase, where it spends until the quiet period runs out and the item becomes executable.- See Also:
-
onLeaveWaiting
An item leaves the waiting phase when the current time of the system is past its due date. The item will then enter either the blocked phase or the buildable phase. -
onEnterBlocked
An item enters the blocked phase when there's someone saying "NO" to it proceeding to the buildable phase, such asQueueTaskDispatcher
. Note that waiting for an executor to become available is not a part of this. -
onLeaveBlocked
An item leaves the blocked phase and becomes buildable when there's no one vetoing. -
onEnterBuildable
An item enters the buildable phase when all signals are green (or blue!) and it's just waiting for the scheduler to allocate it to the available executor. An item can spend considerable time in this phase for example if all the executors are busy. -
onLeaveBuildable
An item leaves the buildable phase. It will move to the "left" state if the executors are allocated to it, or it will move to the blocked phase if someone starts vetoing once again. -
onLeft
The item has left the queue, either by gettingcancelled
or by getting picked up by an executor and starts running. -
all
Returns all the registeredQueueListener
s.
-