Package org.gradle.workers
Interface WorkQueue
-
public interface WorkQueue
Represents a queue of work items with a uniform set of worker requirements. Note that this object is not thread-safe.- Since:
- 5.6
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
await()
Blocks until all work associated with this queue is complete.<T extends WorkParameters>
voidsubmit(java.lang.Class<? extends WorkAction<T>> workActionClass, Action<? super T> parameterAction)
Submits a piece of work to be executed asynchronously.
-
-
-
Method Detail
-
submit
<T extends WorkParameters> void submit(java.lang.Class<? extends WorkAction<T>> workActionClass, Action<? super T> parameterAction)
Submits a piece of work to be executed asynchronously. Execution of the work may begin immediately. Work submitted usingWorkerExecutor.processIsolation()
will execute in an idle daemon that meets the requirements set in theProcessWorkerSpec
. If no idle daemons are available, a new daemon will be started. Any errors will be thrown fromawait()
or from the surrounding task action ifawait()
is not used.
-
await
void await() throws WorkerExecutionException
Blocks until all work associated with this queue is complete. Note that when using this method inside a task action, it will block completion of the task action until the submitted work is complete. This means that other tasks from the same project cannot be run in parallel while the task action is still executing.- Throws:
WorkerExecutionException
- when a failure occurs while executing the work.
-
-