Package hudson.model
Class Queue.Saver
java.lang.Object
hudson.model.queue.QueueListener
hudson.model.Queue.Saver
- All Implemented Interfaces:
ExtensionPoint
,Runnable
- Enclosing class:
- Queue
@Extension
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public static final class Queue.Saver
extends QueueListener
implements Runnable
Schedule
Queue.save()
call for near future once items change. Ignore all changes until the time the save
takes place.
Once queue is restored after a crash, items stages might not be accurate until the next #maintain() - this is not
a problem as the items will be reshuffled first and then scheduled during the next maintainance cycle.
Implementation note: Queue.load() calls QueueListener hooks for every item deserialized that can hammer the persistance
on load. The problem is avoided by delaying the actual save for the time long enough for queue to load so the save
operations will collapse into one. Also, items are persisted as buildable or blocked in vast majority of cases and
those stages does not trigger the save here.-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
onLeft
(Queue.LeftItem li) The item has left the queue, either by gettingcancelled
or by getting picked up by an executor and starts running.void
run()
Methods inherited from class hudson.model.queue.QueueListener
all, onEnterBlocked, onEnterBuildable, onLeaveBlocked, onLeaveBuildable, onLeaveWaiting
-
Constructor Details
-
Saver
public Saver()
-
-
Method Details
-
onEnterWaiting
Description copied from class:QueueListener
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.- Overrides:
onEnterWaiting
in classQueueListener
- See Also:
-
onLeft
Description copied from class:QueueListener
The item has left the queue, either by gettingcancelled
or by getting picked up by an executor and starts running.- Overrides:
onLeft
in classQueueListener
-
run
public void run()
-