类 ForkJoin


  • public class ForkJoin
    extends Task<ForkJoin>
    ForkJoin task 数据定义示例:
     [
          [task-1, task-2],
          [task-3, task-4],
          [task-5]
     ]
     

    执行示例:

     -----------------------------
     |          fork-join        |
     -----------------------------
     |             |             |
     task-1        task-3        task-5
     |             |             |
     task-2        task-4        |
     |             |             |
     -----------------------------
     |           join            |
     -----------------------------
     
    从以下版本开始:
    2024-09-08
    作者:
    SHOUSHEN.LUAN
    • 构造器详细资料

      • ForkJoin

        public ForkJoin​(String taskReferenceName,
                        Task<?>[]... forkedTasks)
        execute task specified in the forkedTasks parameter in parallel.

        forkedTask is a two-dimensional list that executes the outermost list in parallel and list within that is executed sequentially.

        e.g. [[task1, task2],[task3, task4],[task5]] are executed as:

                            ---------------
                            |     fork    |
                            ---------------
                            |       |     |
                            |       |     |
                          task1  task3  task5
                          task2  task4    |
                            |      |      |
                         ---------------------
                         |       join        |
                         ---------------------
         

        This method automatically adds a join that waits for all the *last* tasks in the fork (e.g. task2, task4 and task5 in the above example) to be completed.*

        Use join method @see joinOn(String...) to override this behavior (note: not a common scenario)

        参数:
        taskReferenceName - unique task reference name
        forkedTasks - List of tasks to be executed in parallel
    • 方法详细资料

      • getChildrenTasks

        protected List<FlowTask> getChildrenTasks()
        从类复制的说明: Task
        Override this method when sub-classes will generate multiple workflow tasks. Used by tasks which have children tasks such as do_while, fork, etc.
        覆盖:
        getChildrenTasks 在类中 Task<ForkJoin>
        返回:
      • getForkedTasks

        public Task[][] getForkedTasks()