Annotation Interface ParallelExecutor


@Retention(RUNTIME) @Target(METHOD) public @interface ParallelExecutor
Used in combination with ParallelAgent or ParallelMapperAgent to specify the executor that will be used to run the sub-agents in parallel. The method annotated with ParallelExecutor must be static and return an instance of Executor. It can optionally declare parameters resolved through SupplierParameterResolver.

Example:


    public interface EveningPlannerAgent {

        @ParallelAgent(outputKey = "plans",
                subAgents = { FoodExpert.class, MovieExpert.class })
        List<EveningPlan> plan(@V("mood") String mood);

        @ParallelExecutor
        static Executor executor() {
            return Executors.newFixedThreadPool(2);
        }
    }