Interface Plan<C>
- All Known Subinterfaces:
SimplyComposedPlan<C>
- All Known Implementing Classes:
BarrierPlan,ConditionalPlan,DynamicNestedPlan,ForEachPlan,ForEachSlicePlan,IfElsePlan,MapContextPlan,NestedPlan,PlanMap,RunnablePlan,SimplePlan,UnitPlan
public interface Plan<C>
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new plan that executes this plan and the given plan in parallel.default voidexecute(TaskExecutor taskExecutor, C context) Submit this plan for execution when the caller does not care about the completion of this Plan.voidexecute(TaskExecutor taskExecutor, C context, Runnable onCompletion) Submit this plan for execution.Create a new plan that executes this plan, then the given plan.
-
Method Details
-
execute
Submit this plan for execution.You must call
onCompletion.run()when the plan has completed execution.- Parameters:
taskExecutor- The executor to use for submitting tasks.context- An arbitrary context object that the plan wants to use at runtime.onCompletion- A callback to run when the plan has completed execution, useful for chaining plans.
-
execute
Submit this plan for execution when the caller does not care about the completion of this Plan.- Parameters:
taskExecutor- The executor to use for submitting tasks.context- An arbitrary context object that the plan wants to use at runtime.
-
then
Create a new plan that executes this plan, then the given plan.- Parameters:
plan- The plan to execute after this plan.- Returns:
- The composed plan.
-
and
Create a new plan that executes this plan and the given plan in parallel.- Parameters:
plan- The plan to execute in parallel with this plan.- Returns:
- The composed plan.
-