T
- T is the parameter type that will be passed to the Runnable
implementing the
work item. There can be only one parameter that should encapsulate all data necessary to run
the work action.
High level interaction is as follow :
Runnable
cannot be passed to the Gradle WorkerExecutor
directly as it relies on @Inject to set the parameter value.
submit(Serializable)
API.
Runnable
action that gets
its parameter of type injected with @Inject and create an instance of the
Runnable subclass created in step 2. Runnable.run()
should call back the Runnable
instance
create in step 2 Runnable.run()
public interface WorkerExecutorFacade<T extends java.io.Serializable>
This interface implementation can be used by Task or other higher level implementation classes to provide this facility.
Modifier and Type | Method and Description |
---|---|
void |
await()
Wait for all submitted work actions completion.
|
void |
submit(T parameter)
Submit a new work action to be performed.
|
void submit(T parameter)
parameter
- the parameter instance to pass to the action.void await()