Class AsynchronousExecution

All Implemented Interfaces:
Serializable

public abstract class AsynchronousExecution extends RuntimeException
Special means of indicating that an executable will proceed in the background without consuming a native thread (Executor). May be thrown from Queue.Executable.run() after doing any preparatory work synchronously.

Executor.isActive() will remain true (even though Thread.isAlive() is not) until completed(java.lang.Throwable) is called. The thrower could hold on to a reference to this instance as a handle to call completed(java.lang.Throwable), or look it up later via Executor.getAsynchronousExecution().

The execution may not extend into another Jenkins session; if you wish to model a long-running execution, you must schedule a new task after restart. This class is not serializable anyway.

Mainly intended for use with OneOffExecutor (from a Queue.FlyweightTask), of which there could be many, but could also be used with a heavyweight executor even though the number of executors is bounded by node configuration.

ResourceController/ResourceActivity/ResourceList/Resource are not currently supported. Nor are Queue.Task.getSubTasks() other than the primary task.

Since:
1.607
See Also:
  • Constructor Details

    • AsynchronousExecution

      protected AsynchronousExecution()
      Constructor for subclasses.
  • Method Details