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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidWhen 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.voidonLeft(Queue.LeftItem li) The item has left the queue, either by gettingcancelledor by getting picked up by an executor and starts running.voidrun()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:QueueListenerWhen 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:
onEnterWaitingin classQueueListener- See Also:
-
onLeft
Description copied from class:QueueListenerThe item has left the queue, either by gettingcancelledor by getting picked up by an executor and starts running.- Overrides:
onLeftin classQueueListener
-
run
public void run()
-